Can we keep Mandatory fields in NAV?

Hi,

I have kept FieldA as mandatory in Customer Card, for that i have written code in onqueryclose, onnext and ondelete triggers.

so when you create new customer you will not able to close the page, move to next record without updating FieldA but you can able to delete the record. so this works great.

Here are the issues follows.

  1. In NAV 2016, when you create new customer, New lookup button(OK & New) was added in bottom of the screen. when you click this button new record created and prev record gets saved without calling onqueryclose page trigger. so where do i have to write code to validate OK & New button.

  2. In NAV 2009, When you open customer list from customer card and then selecting other Customer record. the code is above triggers not gets executed. i tried OnDeactive and OnActive triggers also but no use.

Please advice.

Shyam

instead of this you can block the customer while creating and check whether all the mandatory fields are filled while removing blocking

Thanks Mohana,

So whenever new customer created blocked field should be checked using code. so once they completed the customer card update when they try to unblock the customer the mandatory field validation should be executed.

It looks like good option. i will talk with client on this.

Thanks again for your help.

Hi Shyam,
The onqueryclose trigger is called when the page is closed. And at this time it allows you to check if the user has remembered to fill out the mandatory.