Hey Guys,
Whats a low code way to prevent save unless CuryPremiumFreightCost > 0 where an SO or QT order type CuryVatTaxableTotal >$5000.
Cheers,
Hey Guys,
Whats a low code way to prevent save unless CuryPremiumFreightCost > 0 where an SO or QT order type CuryVatTaxableTotal >$5000.
Cheers,
Best answer by darylbowman
Try this:
protected virtual void _(Events.RowPersisting<SOOrder> e, PXRowPersisting b)
{
b?.Invoke(e.Cache, e.Args);
SOOrder row = e.Row;
if (row is null) return;
if (row.OrderType.IsIn(SOOrderTypeConstants.SalesOrder, SOOrderTypeConstants.QuoteOrder) &&
(row.CuryVatTaxableTotal ?? 0m) > 5000m &&
(row.CuryPremiumFreightAmt ?? 0m) == 0)
{
e.Cache.RaiseExceptionHandling<SOOrder.curyPremiumFreightAmt>(row, row.CuryPremiumFreightAmt,
new PXSetPropertyException(row, "Freight must be greater than 0.00", PXErrorLevel.Error));
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.