To create mandatory fields in NF there are three concepts I have tested, all with some bad effects:
1. Using the OnInsert or OnModify Trigger. If you enter values in several fields and one mandatory field is missing all input is reseted. You have to type all fields again. <img border="0" title="" alt="" src="images/smiles/icon_sad.gif" />
2. Using the NotBlank Trigger. You have to set up a default value. In some cases you can't set up a good default value. <img border="0" title="" alt="" src="images/smiles/icon_sad.gif" />
3. The NF Help File suggest to use the BeforePutRecord trigger on the form. If you use this the form allways closes if an error occurres. <img border="0" title="" alt="" src="images/smiles/icon_sad.gif" />
Any better ideas? How do you handle mandatory fields?
Do you use any standars in your projects?
Best wishes for Millenium.
Regards
Michael Krause
0
Comments
NotBlank should only be used for Key Fields.
One way of doing it, would be to on the form (yark), and on the field - Give it a name (View - Properties - Name) press F9 - OnDeactivate you could do the following:
if <Fieldname> = '' then begin
message('You MUST place a value in %1,fieldname(<Fieldname>);
currform.mand1.activate();
end;
Kind regards
Henrik Helgesen
Urmas Pill
urmas.pill@rlk.ee