Is there a way I can accept a password through a dialog box but not displaying what the user type(* instead), something similar to PasswordText property of a textbox on a form? Thanks.
IF gfrmFormPassword.RUNMODAL = ACTION::LookupOK THEN
password := gfrmFormPassword.FunctionToReturnPassword
ELSE IF gfrmFormPassword.RUNMODAL = ACTION::LookupCANCEL THEN
........
Somehow this doesn't work. The control is not coming to the THEN part when the user type in the correct password. But if I change the ACTION to CLOSE it comes there, then the problem is it always comes to the THEN part( Even when the user hit Esc or click Cancel on the password form)
To work you cannot add code in the ok button. Try doing the validation after the password form is closed, or in the validate trigger of the password textbox.
Comments
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
gdlgWindow.INPUT(1,gtxtPassword);
It is better to create a form.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I need to achieve the following.
1. Continue the processing if the user input the correct password.
2. Abort the processing if the user Escaped or hit Cancel on the password form
How do I know if the user did one of the above from the calling function? Thanks for any help.
variables:
gfrmFormPassword type form
gfrmFormPassword.LookUp(TRUE);
IF gfrmFormPassword.RUNMODAL = ACTION::LookupOK THEN
password := gfrmFormPassword.FunctionToReturnPassword
ELSE IF gfrmFormPassword.RUNMODAL = ACTION::LookupCANCEL THEN
........
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
gfrmPassword.LOOKUPMODE(TRUE);
IF gfrmPassword.RUNMODAL = ACTION::LOOKUPOK THEN
ChangeSubMenu(50242);
CLEAR(gfrmPassword);
and this is the code on the Onpush() of the Ok button on the Password form
IF gtxtPassword = 'IT' THEN
CurrForm.CLOSE
ELSE
MESSAGE('Wrong Password, Try again!');
The THEN part doesn't execute if the user type in IT as password
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
VarOption integer
gfrmPassword.RUNMODAL;
gfrmPassword.GetValueOption(VarOption)
IF VarOption = 1 THEN
ChangeSubMenu(50242);
CLEAR(gfrmPassword);
On the password form create a global variable VarOption and function GetValueOption to return the value of VarOption
GetValueOption(var pVarOption)
{
pVarOption := VarOption
}
and this is the code on the Onpush() of the Ok button on the Password form
IF gtxtPassword = 'IT' THEN BEGIN
VarOption = 1
CurrForm.CLOSE;
END ELSE
MESSAGE('Wrong Password, Try again!');
Hope this helps
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com