Skip to main content
Solved

Enable field in Bills and Adjustments(AP301000)

  • July 10, 2023
  • 5 replies
  • 113 views
  • Translate All

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

5 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20

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

Translate

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

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

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20

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

Translate

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

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

Translate

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

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);
}
}



 

Translate