I am wondering if someone can help me. I need to validate values entered on
the dialog fields and inform the user if validation fails and keep the dialog
form open.
My problem is I can only validate values once the dialog is run and this
automatically closes the dialog window. I want to keep the dialog window open.
Any ideas?
Thanks
DAXFan
there is a article about that.
Take a look at:
http://blog.ak-home.net/PermaLink,guid,374336de-6b3d-4ce4-9d89-b11f1197bcb3.aspx
Hope that helps you.
--
Sincerely yours
Axel Kühn (visit my Dynamics AX blog at: http://blog.ak-home.net)
yes there is a way to translate the arctile....
Just use for example http://babelfish.altavista.com/ to translate it.
--
Kashperuk Ivan (Vanya),
Dynamics AX MCBMSS
My blog - http://kashperuk.blogspot.com
MorphX IT in Russian - http://www.lulu.com/content/723888
But, thanks a lot for your inputs, especially Axel.
Regards.
1. getfromdialog = this method is use to put values entered in the dialog
box into variable declared in the class declaration.
2. validate with boolean as return value : validate your values here using
the variable.
Cheers
I want keep the dialog window open, and just inform the user of invalid
entries.
Thanks
Getfromdialog method does not do much then just copying the values enterd in
the dialog box to the variable you created in your class declaration. For
stopping the window from closing you have to write the validate method and
return false value if validation fails.
See the following example:
class dlgTest extends runbase
{
dialogfield dlgfldCust;
custAccount custAccount;
}
static void main(args _args)
{
dlgTest dlgTest = new dlgTest();
if(dlgTest.prompt())
dlgTest.run();
}
public boolean getFromDialog()
{;
custAccount = dlgfldCust.value();
return true;
}
public boolean validate(Object calledFrom)
{
boolean ret = super();
if(custAccount && !CustTable::find(custAccount))
ret = ret && CheckFailed("Invalid Customer account");
return ret;
you don't have to call validate method system calls it by itself.
As soon as you enter the value in the field on dialog box system calls
getfromdialog method and then make a calls to validate method.
Regards
Jag