Skip to main content
Solved

Restrict AR Invoice, Document type for users

  • Jan 26, 2022 6:20 AM UTC
  • 3 replies
  • 273 views
  • Translate All

Forum|alt.badge.img

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 @apallawala21 

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
    }
 

View original

3 replies

Jp89
Varsity I
Forum|alt.badge.img
  • Jan 26, 2022 6:58 AM UTC

@danamoffat89 

I'm glad to see that I not the only one requesting this, also as listed in my list of complaints.

Translate

jinin
Pro I
Forum|alt.badge.img+12
  • Pro I
  • Answer
  • Jan 27, 2022 5:57 AM UTC

Hi @apallawala21 

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
    }
 

Translate

Forum|alt.badge.img
  • Jr Varsity II
  • Sep 1, 2022 12:33 PM UTC

@danamoffat89

I'm glad to see that I not the only one requesting this, also as listed in my list of complaints.

Thank you for highlighting that I hope in the future release this will be addressed in a simple manner

Translate