A nifty trick for comparing the "old" value against the "new" value using "obj.orig()" when validating a field on a form.
Example:
Change the behavior of the "Customer Group" on "CustTable" form.
Overwrite the method "validate" on the field "CustGroup" on the data source on "CustTable" public boolean validate()
{
boolean ret;
ret = super();
return ret;
}
Change method:
public boolean validate()
{
boolean ret;
;
if(custTable.orig().CustGroup == '30') // Non changeable group.
{
info('You cannot change this Customer group');
ret = false;
} else {
ret = super();
}
return ret;
}
Note: I've explained the general principle for validating a field against it's old value, however there are some issues with the data source not refreshing data set when changing the value back and forth.
Subscribe to:
Post Comments (Atom)
How to identify the user that was used to change an object from AOT in AX2012
Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...
-
Combo boxes in Dialogs are added by adding a DialogField object with the type of an enum. The enum is then controlling what items you can pi...
-
This article explains: How to picking list through a job using X++ in Dynamics AX. Applied on: Dynamics AX 2009 SP1 Create a job a...
-
A while ago I had the need to translate labels, I was creating eMail bodys while using SysMailer and wanted to use different languages for d...
No comments:
Post a Comment