Variables:
Purchase Line."no."
Text2 var code
Code:
On the ONVALIDATE section of field Purchase Line."no."
If Purchase Line."no.">5 then
currform.activate.text2
IT seems so simple but does not work. The cursor remains in the Purchase Line."no." field
I have no nextcontrols set. Anybody know why???
0
Comments
onvalidate based on an if then statment.
Correct :?:
thats also ;-)
RIS Plus, LLC
Regards
section the code has no effect. The Nextcontrol is undefined.
Does not work with any key. How does one move the focus to a specific field after validation (Enter Key) without using NEXTCONTROL??
You need to take into account the sequence that Nav fires triggers and excutates actions. What happens is that the field validates and then you issue the command to activate the second field (field2). Nav does this but then the action after the validate is to go the next field ( of the cative field) which is the NextControl of field2
For example to get the sales order subform to return to the description field from the quantity field if the quantity is greater than 5 you would need to add in the OnValidate trigger :
IF Quantity > 5 THEN
CurrForm."No.".ACTIVATE;
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Yes exactly what I am attempting to accomplish. Yet the cursor remians focused in the QTY field. IT does not jump to the description field. Even when I create simple test form I cannot get the focus to change unless I use nextcontrol.
if it works, then your condition has something wrong, otherwise, try to change the trigger
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Even if I create a simple test form with NO,DESC,QTY and no controls and no code and then add code to the onvalidate tigger of NO field the code
CURRFORM.QTY.ACTIVATE;
The focus should jump to the QTY field yet remains in the no field.
it MUST work (as it works for me and everyone else i think)
try to name your textboxes (i literally mean "name" property of the textboxes), and then use currform.nameoftextbox.activate
this is to check if you're calling the wrong control.
anyway, did you try to comment the "if" statement, leaving only the "activate" instruction?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I am using v3.6
I had removed the "IF" statement in my previous code testing.
Perhaps the ZUP file is causing this problem? The currform.activate does work on the onactivate tigger and the drilldown triggers. It will not work on the onvalidate or onaftervalidate triggers. If I try on the onformat section it crashes Navision.
Could be Navision v3.6 problem as this is very simple code.
have you got some other code under the onvalidate of the table or the form?which code?
did you check the properties?is the destination field focusable(this is really stupid but who knows)?is it on the same tab?(i don' remember if the activate works across different tabs)
well, i think your problem is a nondefault property or some code under validates...i cannot try guess more than this!
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Yes I even created a new table and form with zero code. onvalidate - Currform.var1.activate now jumps the focus to the HELP button. I know Navision forms has bugs this must be another.