Hello team,
I am implementing function that bring field Account Name from Bill-To-Info section in Customer (AR303000) to Customer Details screen (AR402000)
Details of field Account Name from Bill-To-Info section:

When I first time select customer, the result is correct:

Then I select another Customer, this field is still remaining the previous result

If I refresh the page, this field will display correct name.
Here is my code: I create a field UsrAccountName in ARDocumentResult and implement FieldSelecting as following
#region UsrAccountName
PXString(255, IsUnicode = true)]
PXUIField(DisplayName = "Account Name", Visibility = PXUIVisibility.SelectorVisible)]
public virtual string UsrAccountName { get; set; }
public abstract class usrAccountName : PX.Data.BQL.BqlString.Field<usrAccountName> { }
#endregion
protected void ARDocumentResult_UsrAccountName_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
{
var row = (ARDocumentResult)e.Row;
if (row == null)
{
return;
}
Customer customer = PXSelect<Customer,
Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>.Select(Base, row.CustomerID);
if (customer == null) { return; }
Contact billContact = PXSelect<Contact,
Where<Contact.contactID, Equal<Required<Contact.contactID>>>>.Select(Base, customer.DefBillContactID);
if (billContact == null) { return; }
e.ReturnValue = billContact.FullName;
}
I do the same way and could bring field from ARinvoice but somehow it doesn’t work with the field BillTo->FullName of Customer.
Do you have any idea?
Any suggestion would be appreciated.