Skip to main content
Solved

Enable field in Bills and Adjustments(AP301000)


Forum|alt.badge.img

Hi Experts.

I want enable field Subaccount in the below image.

I try:

 PXUIFieldAttribute.SetEnabled<APTran.subID>(cache, row, true); 

and set enable in worflow:

but it not work (I try this solution for Sales Orders screen SO301000 and success).

Can you help me?

Thank everyone so much.

Best answer by Keith Richardson

There are many places inside the row selected for both APTran and APInvoice event that it enable/disables the field. Ensure you are calling the delegate in row selected first, before changing the state.
 


    public class APInvoiceEntrySetSubIDEnabledExt : PXGraphExtension<APInvoiceEntry>
    {

        //set in the APTran row selected event
        public virtual void _(Events.RowSelected<APTran> e, PXRowSelected del)
        {
            //call delegate first
            del?.Invoke(e.Cache, e.Args);
            //then change enabled to true
            PXUIFieldAttribute.SetEnabled<APTran.subID>(e.Cache, e.Row, true);
        }


        //Set in the APInvoice row selected event
        public virtual void _(Events.RowSelected<APInvoice> e, PXRowSelected del)
        {
            //call delegate first
            del?.Invoke(e.Cache, e.Args);
            //then change enabled to true
            PXUIFieldAttribute.SetEnabled<APTran.subID>(Base.Transactions.Cache, null, true);
        }
    }



 

View original
Did this topic help you find an answer to your question?

5 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • July 10, 2023

Hi @thanhaim  Can you please check the below article, it will help you to enable the fields, when the document is moved to the read-only mode.

 

https://asiablog.acumatica.com/2021/10/enable-customization-fields-when-document-is-completed.html


Forum|alt.badge.img
  • Author
  • Freshman II
  • 35 replies
  • July 10, 2023

Thank @Naveen Boga. This article same my solution, but not work for screen Bills and Adjustments(AP301000).


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • July 10, 2023

@thanhaim  Can you please share the Customization project that you have tried and not working, so that I can check from my end and fix it.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2754 replies
  • August 9, 2023

Hi @thanhaim were you able to find a solution? Thank you!


Keith Richardson
Semi-Pro I
Forum|alt.badge.img+2

There are many places inside the row selected for both APTran and APInvoice event that it enable/disables the field. Ensure you are calling the delegate in row selected first, before changing the state.
 


    public class APInvoiceEntrySetSubIDEnabledExt : PXGraphExtension<APInvoiceEntry>
    {

        //set in the APTran row selected event
        public virtual void _(Events.RowSelected<APTran> e, PXRowSelected del)
        {
            //call delegate first
            del?.Invoke(e.Cache, e.Args);
            //then change enabled to true
            PXUIFieldAttribute.SetEnabled<APTran.subID>(e.Cache, e.Row, true);
        }


        //Set in the APInvoice row selected event
        public virtual void _(Events.RowSelected<APInvoice> e, PXRowSelected del)
        {
            //call delegate first
            del?.Invoke(e.Cache, e.Args);
            //then change enabled to true
            PXUIFieldAttribute.SetEnabled<APTran.subID>(Base.Transactions.Cache, null, true);
        }
    }



 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings