Hello,
I know this is probably a basic thing I am over looking, but cannot get it to work. Basically, in our setup, users are able to delete orders with items that are shipped but not invoiced. We want to be able to prevent this from happening. I placed code in the OnBeforeDelete trigger of the Service Line table, but it still is letting the record be deleted. My code is below.
trigger OnBeforeDelete(); begin if ("Quantity Shipped" > "Quantity Invoiced") then Error('Cannot Delete Line %1 because there are lines Shipped not Invoiced',"Line No."); end;
I also want to know if I put this code in the line level, and they click delete on the header level of the order, will it stop and prevent all lines from being deleted.
Thanks,