I have created AvailPhysical quantity on the salesline,
when we have available physical quantity for all or any time of the line then only the confirmation and confirm button should be enabled,
secondly for the packing slip, if the user have not done confirmation then he will be unable to do the picking slip it have to throw the error as throw error("Packing slip cannot be done without confirmation.");
again same thing for the Invoice, if user have not done packing slip then hen he will be unable to do Invoice which throw the error as throw error("Invoice cannot be done without Packing slip.");
After your suggestions I have found one code as SalesTableInteraction class but it is giving error for the macros when I put # before setenabled.
[ExtensionOf(classstr(SalesTableInteraction))]
internal final class XTSSalesTableInteraction_Extension
{
protected void enableLineActions()
{
next enableLineActions();
real XTSAvailPhysical;
if(XTSAvailPhysical == 0)
{
setEnabled(formControlStr(SalesTable,buttonUpdateConfirmation),false);
setEnabled(formControlStr(SalesTable,buttonUpdateConfirm),false);
}
else
{
setEnabled(formControlStr(SalesTable,buttonUpdateConfirmation),true);
setEnabled(formControlStr(SalesTable,buttonUpdateConfirm),true);
}
if(formControlStr(SalesTable,buttonUpdateConfirmation),false) && (formControlStr(SalesTable,buttonUpdateConfirm),false))
{
setEnabled(formControlStr(SalesTable,buttonUpdatePackingSlip),false);
throw error("Packing slip cannot be done without confirm.");
}
else
{
setEnabled(formControlStr(SalesTable,buttonUpdatePackingSlip),true);
}
if(formControlStr(SalesTable,buttonUpdatePackingSlip),false)
{
setEnabled(formControlStr(SalesTable,buttonUpdateInvoice),false);
throw error("Invoice cannot be done without Packing slip.");
}
else
{
setEnabled(formControlStr(SalesTable,buttonUpdateInvoice),true);
}
}