mandatory fields in master data entry

hi,

how can we imlement mandatory field data entry duing mastger data entry?

example ( durign item master entry, we want fields ite category, product grop & item diemension to be enterd. we do not want the users to come out of the form without entering this info. othrewise we do not want the record to bve saved.)

thanks

salesh

One of the options is to test in the “OnQueryCloseForm”:

IF ("Item Category Code" <> '') AND ("Product Group Code" <> '') THEN BEGIN
EXIT(TRUE);
END ELSE BEGIN
MESSAGE('You need to fill in the Item Cateory and Product Group fields");
EXIT(FALSE);

This only helps when the user closes the form - not when moving to thenext/previous record.

Another option would be to add the following code to the OnModify trigger of the table:

TESTFIELD("Item Category Field");
TESTFIELD("Product Group Code");

The one I like most is to change the InitValue of the Blocked field to Yes. This means that by default you can’t use the Item anywhere, because it’s set up as a blocked Item. Then in the OnValidate of the Blocked field, you program the checks for the mandatory fields, and only allow the field to be set if those mandatory fields have the right values.