Like most things in Navision, this is a pretty simple thing to do, you just need to look at it from a difernt perspective.
basically I guess you are trying to set up some paramaters, and based on these, send the cursor to a different field. So …
Create a new function GoToNextField;
Create a variable LastFieldNo and TmpLastFieldNo integers
The function will be something like:
Tmplastfieldno := lastfieldno;
lastfieldno := 0;
Case LastFieldNo of
1000 : CurrForm.Description.ACTIVATE;
2000 : CurrForm.MyControl.ACTIVATE;
4400 : CurrForm.Someothercontrol.ACTIVATE;
end;
Now in the field that the user needs to be in,set the porperty NextControl to point to a new dummy control. This will be a control hidden ont he form somewhere and not used. Call it GoToControl
Also in the Activate Trigger add the code
LastFieldNo := 2000; // paramater is the number of the current control
In the control GoToControl, add the follwoing code in the on activate trigger add:
but it not works, every time focus goes to the next textbox I specified. If have time please, make *.txt file from code bellow, and import to the navision and see how I did.
I cant find any way to attach my form in Fob format.
Thank you
OBJECT Form 77776 Test tab orders
{
OBJECT-PROPERTIES
{
Date=06/12/06;
Time=[ 2:43:58 PM];
Modified=Yes;
Version List=;
}
PROPERTIES
{
Width=17050;
Height=4400;
SourceTable=Table18;
OnAfterGetCurrRecord=BEGIN
CurrForm.“Search Name”.ENABLED := (“No.” <> ‘10000’);
END;
Are you using a list form - If so, you MIGHT hsve to activate the control in front of it - Not sure why - I just know I have had to do that a lot of times.
I useally place the code on the OnAfterValidate trigger - and have had no problems with that.
It is very unlikely that this will solve the issue here. The issue is a design problem wher ean infintie loop is created. Firstly it is created localy on the client, so its probably the local cache that will help, nort server cacehe, but even if you increase cache, that will jsut mean it will take longer to fill the ceche before the error is triggered.
The solution is to redesign the code as I suggested in the begining.
thank you for answers, but neither first nor second suggestion doesn’t work.
for second suggestion, I was do as you described, but it is not worked correctly. I have been upload my test form in txt format, if you have a time, please look at it. In my example, Name field after getting focus immediately loses it, user can not see this process, I saw it just by debuging.
I’ve import txt file you sent, but it is not what I need.
First i need to situate fields in 2 columns,
Example
AAA BBB
CCC
DDD EEE
and tab order must be AAA,BBB,CCC,DDD,EEE
In some reason CCC field must be disabled, in this case Navision moves focus from BBB to the EEE field(as they in same column), but if CCC is disabled I need to go DDD before EEE.
And secondly your code is not worked because of GoToControl textbox is unvisible and can not got focus, therefore it cannot run GoToNextControl; function.