Archive for category C/SIDE

Mandatory fields on forms

A common customer request is mandatory fields and I usually recommend a solution where a test is made at posting time. This seems to be “the Navision way” and I see a value in keeping things consistent.
Once in a while though, there is a real need for a field to be mandatory from the moment it is inserted.
This is a simple solution for records that does not use no. series or other special logic for creating the primary key.

  1. Set the NotBlank property on the field to Yes
  2. Add a FieldName.TESTFIELD to the table OnInsert trigger.
  3. Set the DelayedInsert property on the form to Yes

No guarantees, just something had forgotten about and needed again the other day.

, ,

No Comments