Skip to main content
Solved

Enable field in Bills and Adjustments(AP301000)


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.

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


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


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


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


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