Edit Checking on Sales Order form #42.

I am trying to do some edit checking on Sales Order form #42. Before a Sales Order can be released I added some code to make sure certain fields are entered on the Cal/Code of the Function - Release portion.

For some reason it only checks the first edit check I have in place and ignores all the other ones.

Here is my code:

IF (“External Document No.” = ‘’) THEN

ERROR (‘Must enter External Document No.’);

EXIT;

IF (“Customer PO Date” = 0D) THEN

ERROR (‘Must enter Customer PO Date’);

EXIT;

IF (“Salesperson Code” = ‘’) THEN

ERROR (‘Must enter Salesperson Code’);

EXIT;

IF (“Ship-to Code” = ‘’) THEN

ERROR (‘Must enter Ship-to Code’);

EXIT;

IF (“Location Code” = ‘’) THEN

ERROR (‘Must enter Location Code’);

EXIT;

As it is right now I only get an error message pop up if the External Document No. is blank. All other IF’s don’t give me an error message.

Thanks in advance,

Greg

Try:

IF (“External Document No.” = ‘’) THEN BEGIN
ERROR (‘Must enter External Document No.’);
EXIT;
END;

And put that BEGIN-END into all lines.

Btw - net necassary to use EXIT as ERROR aborts the execition.

The transaction aborts at en ERROR, so it doesn’t get to any statements after the first error. If you want to see all of it, you have to put in place messages instead. Keep track of the number of messages, and if the number of messages is greater than 0 you do an ERROR.

Thanks for the replies. It works better now.

I took the EXIT out and just used the error with BEGIN and END;

Greg