Discussion of Mandatory fields

Michael_KrauseMichael_Krause Member Posts: 10
edited 2000-01-04 in Navision Financials
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

Comments

  • AnonymousAnonymous Guest Posts: 137
    That is correct.

    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
  • UrmasUrmas Member Posts: 76
    Another way is to use the forms OnModifyRecord / OnInsertRecord triggers. If the data does not pass the check, you display a message for a user and return false as a result. That way the data will be retained and the input can't be accomplished before the data is correct.

    Urmas Pill

    urmas.pill@rlk.ee
Sign In or Register to comment.