In NAV 5.0 Employee table I have created a new Global Variable (Boolean). It is set to true by the OnValidate triggers of various fields and in the OnModify trigger, a function is run if it is true. I have tested and it is set correctly by the OnValidate triggers but when it reaches the onModify it is false (No). I know there is nothing setting it to false because it is a new variable I have created. There is no CLEARALL statement in either the table or form code (I have exported them as text and searched. Can anyone suggest how I can track down what is changing it? I have tried changing a field which sets the global to true and then immediately doing a page-down to trigger the OnModify but something is resetting it in between these two functions.
0
Answers
I think the best thing you can do is using the debugger and adding a watch on that global to see when it changes.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
You could add your variable as a field.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
SalesLineVar.VALIDATE("No.");
SalesLineVar.MODIFY(TRUE);
SalesLineVar.FunctionToMessageVariable;
In such a scenario the variable remains.
I think it causes some issues in some cases but somehow I believe it's better that it happens like that.
Correct. The globals are cleared between the OnValidate and the OnModify (just tried it out). BUT the records in a globally declared temptable are NOT cleared! This is the code I tried and it works:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!