Navision's user interface can be a serious pain to control in any meaningful manner at times, it has automatic behaviour that can be difficult to override.
There are properties each control can have that passes focus to another one on input. It also depends on where you put your code and exactly what you are trying to do. Sometimes you can put the checking code in the next control, of which this is an example that does not pass control from the first text box to the second unless the number is 1 (the check code is in the OnActivate of the second textbox):
OBJECT Form 70000 numtest
{
OBJECT-PROPERTIES
{
Date=09/04/07;
Time=21:13:55;
Modified=Yes;
Version List=;
}
PROPERTIES
{
Width=6930;
Height=2090;
}
CONTROLS
{
{ 1000000000;TextBox;660 ;770 ;1700 ;440 ;Name=NumControl;
SourceExpr=num }
{ 1000000001;TextBox;4180 ;770 ;1700 ;440 ;Name=NumControl2;
SourceExpr=num2;
OnActivate=BEGIN
IF num <> 1 THEN CurrForm.NumControl.ACTIVATE;
END;
}
}
CODE
{
VAR
num@1000000000 : Integer;
num2@1000000001 : Integer;
BEGIN
END.
}
}
Which form are you trying to do this in?
If you could post your code as a text it would help to see exactly what context in which you are trying to do what you want.
i written code on text box - on validate trigger..
if the value of the text box is changed then they have to change the item ledger entry releted to that no....
so when they are changing the value , it ask for confirmation ...do u want to change the no...i want, when they press no..then the cursor appear in to the same text box with the original value..
i try for this..but the value is change in the text box when they click on no button on confirmation message...and the cursor is appear in to the next text box...
but i only want that when they click on no button in the confirmation..the cursor is go to the same text box..with the original value...
i written code in the onvalidate trigger of the no text box...
Comments
CurrForm.NamedControl.ACTIVATE;
CurrForm."No.".ACTIVATE;
But the cursor is move to next control...
i wrriten this code on on activate trigger of the NO. field..
IS is OK ???
I want when i got some value when the user input any thing in text boz..
eg..if the value which user enter is ' yes' then cursor dont move on next control..the cursor must be stay there with the old value......
There are properties each control can have that passes focus to another one on input. It also depends on where you put your code and exactly what you are trying to do. Sometimes you can put the checking code in the next control, of which this is an example that does not pass control from the first text box to the second unless the number is 1 (the check code is in the OnActivate of the second textbox):
Which form are you trying to do this in?
If you could post your code as a text it would help to see exactly what context in which you are trying to do what you want.
in that one text box is there...
i written code on text box - on validate trigger..
if the value of the text box is changed then they have to change the item ledger entry releted to that no....
so when they are changing the value , it ask for confirmation ...do u want to change the no...i want, when they press no..then the cursor appear in to the same text box with the original value..
i try for this..but the value is change in the text box when they click on no button on confirmation message...and the cursor is appear in to the next text box...
but i only want that when they click on no button in the confirmation..the cursor is go to the same text box..with the original value...
i written code in the onvalidate trigger of the no text box...
Just noting that Item Ledger Entries are not usually there for changing.
I assume "No." is some custom field you added?
http://www.BiloBeauty.com
http://www.autismspeaks.org