Solved

How to embed value on Customer record in Sales Order - The field I placed only shows when screen calls back

  • 13 February 2024
  • 3 replies
  • 28 views

Userlevel 3
Badge

 

I added a field on a customer record to the SO header.

 

 

 

 

 

 

When I add this customer to the SO the field appears as does the value on the customer record.

 

However, when I close the record and return to it later the value disappears.  If I do something in this record and save it again the value will reappear.  Below is the attribute...do I need to add something here?  I have tried to commit the changes but that does not work.  Advise would be appreciated.

 

[PXDBBool]
[PXUIField(DisplayName="COA")]

 

 

icon

Best answer by Naveen Boga 13 February 2024, 07:11

View original

3 replies

Userlevel 7
Badge +17

@dgross Write a field updated event for the CUSTOMER ID in the Sales Order screen to fetch the COA field value from the Customers screen and assign it in the Sales Order screen custom COA field.

Here is the sample code for your reference.

 

 public class SOOrdeEntryExt : PXGraphExtension<SOOrderEntry>
{

protected virtual void SOOrder_CustomerID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e, PXFieldUpdated InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
SOOrder row = e.Row as SOOrder;
if (row != null)
{
Customer objCustomer = Customer.PK.Find(Base, row.CustomerID);
SOOrderExt rowExt = row.GetExtension<SOOrderExt>();
CustomerExt CustomerExt = objCustomer.GetExtension<CustomerExt>();
if (objCustomer != null)
{
rowExt.usrCOA = CustomerExt.usrCOA;
}
}
}

}

  

Userlevel 3
Badge

HI Naveen, thanks for the quick response.   I am, however,  looking for a non-coding kind of answer.  Is there nothing in the Layout properties or Attribute that will accomplish this or is the only option to add code?  

Userlevel 7
Badge +17

Yes, it requires code level customization.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved