Hi
I am trying to make a field required when a customer tax zone is specific on the SO order type. The problem i am having is making this field required when trying to create a shipment. So the field will not be required on SO creation, but rather when trying to invoice.
Answer
Sales Order Workflow Customization - Making field required on a condition
Best answer by Django
Probably the easiest way would be to do the test in an override of the .Persist method. That will allow you to prevent the invoice from being saved if the conditions aren’t met.
public delegate void PersistDelegate();
[PXOverride]
public void Persist(PersistDelegate baseMethod)
{
ARInvoice row = Base.Document.Current;
ARInvoiceExt rowExt = row.GetExtension<ARInvoiceExt>();
if (row != null)
{
//do your test here. If the record fails, throw a PXException.
}
baseMethod();
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

