error message problem

hi all

i have a strange problem.i’ve added an error message in the deactivate trigger of a certain list form that would appear if the sum of all quantities in the form does not equal a predefined value. the error message appears right but when it’s ok is pressed the followings appears (Microsoft dynamics NAV classic has encountered a problem and needs to close) and navision closes.

does anyone know what is the possible reason behind that?

one reason could be because of the Zup file. trying deleting it and check.

All the best.


The C/AL code in this trigger is executed when the control is deactivated.

Applies to

Command buttons, menu buttons, check boxes, option buttons, text boxes, picture boxes, indicators, subforms


When you call the ACTIVATE function, the system executes the code in the OnDeactivate trigger before it executes the OnActivate trigger for the new control. In other words, the system executes this trigger before it deactivates the control.

If there is an error in the C/AL code you enter into this trigger, the system closes the form.

You cannot use this trigger to write to the database.

Please find the alternate trigger to put the code.

Hello again Rim,

Maybe if you explained what you are trying to do we can help you find a way to do this that fits NAV SOP.

(back to that question again… [;)] )

mmmm thank you all. well i used message instead of error message and activate the current form after it to force the user to correct the error before leaving the form.i know that this is an indirect and unsatisfied solution but that was what i could do[:S].thank you again for trying to help me

Perhaps if you explain what you are trying to do, which fields, etc. a better solution can be proposed to you.