I am doing some error checking on the Purchase Line Subform # 54. Were using Dimensions and if it’s a G/L account we want to make sure they can only use certain account #'s and dimension #'s. The code works but when they put in a invalid value it closes the form after the ERROR message pops up.
Here is the code:
IF (Type = 1) AND // Only looking at G/L line items
(ShortcutDimCode[3] > ‘02’) AND // set the value range
(ShortcutDimCode[3] < ‘13’) AND
(“No.” < ‘6000’) THEN BEGIN // any account #'s less than 6000 are invalid
ERROR(‘G/L Account Invalid’);
END;
I need to add something here so it doesn’t close the form after clicking OK on ERROR message.
That is because the field validation code is on the form. If this code were in the field validation trigger of the table (where it belongs in my opinion) then the form would not close after the error.
Unfortunately the Dimension I’m testing for isn’t on the Purchase Line table so I can’t put it in the table. If you look at the record in the purchase line table it’s not on there but it shows up on the form.
Not sure how it ties into the Purchase Line table.