Hello!
Is there any possible way to restrict some of the document types for users?
For example, we need to restrict the ‘Credit Memo’ document type for one user.

Thank You,
Regards
Amanda
Hello!
Is there any possible way to restrict some of the document types for users?
For example, we need to restrict the ‘Credit Memo’ document type for one user.

Thank You,
Regards
Amanda
Best answer by jinin
Hi
We can achieve this through customization. We need to customize the Doc. Type field and restrict the types. Need to provide conditions based on the User Role.

Sample code:
public class SOInvoiceEntry_Extension : PXGraphExtension<SOInvoiceEntry>
{
#region Event Handlers
[PXDBString(3, IsKey = true, IsFixed = true)]
[PXDefault()]
[ARInvoiceTypeExtn]
[PXUIField(DisplayName = "Type", Visibility = PXUIVisibility.SelectorVisible, Enabled = true, TabOrder = 0)]
[PXFieldDescription]
protected virtual void ARInvoice_DocType_CacheAttached(PXCache cache)
{
}
public class ARInvoiceTypeExtn : PXStringListAttribute
{
public ARInvoiceTypeExtn() : base(
new[]
{
Pair(ARDocType.Invoice,ARDocType.GetDisplayName(ARDocType.Invoice)),
Pair(ARDocType.CashSale,ARDocType.GetDisplayName(ARDocType.CashSale)),
Pair(ARDocType.CashReturn,ARDocType.GetDisplayName(ARDocType.CashReturn)),
// Pair(ARDocType.DebitMemo,ARDocType.GetDisplayName(ARDocType.DebitMemo)),
})
{ }
}
#endregion
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.