I have a custom field on the customers screen for biller/billing nbr. I want to default that onto the sales orders screen when the customer value is updated. I attached my current code to add biller/billing nbr onto the customers screen and sales orders screen. Right now, I had attempted to reset the default value on the sales orders screen when the location was updated, but it still isn’t populating. What am I missing within the code to populate the custom field?
Answer
PXDefault Value Based on Related Record Is not Populating
Best answer by Naveen Boga
Hi
I just reviewed and the above code should work as provided by
Below is the updated code and customization package.
Hope this helps!
protected void SOOrder_CustomerID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e, PXFieldUpdated InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
if (e.Row == null) return;
var row = (SOOrder)e.Row;
BAccount customerRow = BAccount.PK.Find(Base, (int)row.CustomerID);
BAccountExt customerRowExt = customerRow.GetExtension<BAccountExt>();
SOOrderExt orderRowExt = row.GetExtension<SOOrderExt>();
orderRowExt.UsrBillerNbr = customerRowExt.UsrBillingNbr;
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.