HI @LungileNjakazi37,
If we assign the PXDefault or PXDefaulting event for the override contact field, it doesn't work. However, we can write the code in the Customer Field Updated event, and it works.
Please refer to the code snippet below:
protected void SOOrder_CustomerID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e, PXFieldUpdated InvokeBaseHandler)
{
if (InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (SOOrder)e.Row;
if (Base.Billing_Contact.Select().FirstOrDefault() != null)
{
Base.Billing_Contact.Current = Base.Billing_Contact.Select().FirstOrDefault();
Base.Billing_Contact.Current.OverrideContact = true;
Base.Billing_Contact.Update(Base.Billing_Contact.Current);
}
}