NotBlank in condition...

PavlosPavlos Member Posts: 19
edited 2004-04-21 in Navision Attain
Hi to all,

I have a rather simple question. What I want to achieve is to force the user to enter a value in some specific fields if a condition is met. More precisely on the order form if the customer is a foreign customer then I want to make sure that the user will fill some specific fields on the order form (ie Sales Header). I’ve used the TESTFIELD on the onBeforePutRecord trigger but the problem is that it closes the form on error. What I want is to prompt the user in which field(s) he/she has to enter a value and not close the form. The record should not be saved until the required fields are filled.

Thanks in advance.

Comments

  • DenSterDenSter Member Posts: 8,307
    Open the table in design, select the field, open the properties page, find the NotBlank property and set it to Yes. That should do the trick.
  • PavlosPavlos Member Posts: 19
    Hi DenSter,

    thanks for your reply. What I want is to make a field mandatory if a condition holds. For example to check the country of the customer and if the customer is a foreign customer then some fields will become mandatory and the user should notified that he has to fill in these fields. If the customer is not a foreign customer then these fields can be left blank.
    Any ideas?
  • DenSterDenSter Member Posts: 8,307
    Well the simple solution would be to require the user to enter the other fields before he's allowed to change the country, and that would be accomplished in the OnAfterValidate trigger of the field in the table. I wouldn't do any of this on any of the form triggers. That way, if you add the table to another form, the same behaviour will happen on the new form.
Sign In or Register to comment.