Hi,
Customer would like to have the Override Address checkbox set to true as the default on the Sale Order.I have not been able to get a customization to work. Any help would be appreciated.
Thanks,
Coleen
Best answer by jinin
View originalHi,
Customer would like to have the Override Address checkbox set to true as the default on the Sale Order.I have not been able to get a customization to work. Any help would be appreciated.
Thanks,
Coleen
Best answer by jinin
View originalHi
If we assign the PXDefault or PXDefaulting event for the override address 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.Shipping_Address.Select().FirstOrDefault() != null)
{
Base.Shipping_Address.Current = Base.Shipping_Address.Select().FirstOrDefault();
Base.Shipping_Address.Current.OverrideAddress = true;
Base.Shipping_Address.Update(Base.Shipping_Address.Current);
}
}
So the code above will the override default as always true on the address tab on the SO?
Yes
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.