Using Variables with Forms [AX 2012]
Updated: October 11, 2008
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
Variables usually need to be declared before they can be used. Working with forms, however, some variables are implicitly declared by the system.
The system creates a variable. Its name is the same as the table's that is used as a data source. This enables you to do the following:
-
Call a method defined on the table used as a data source for the form. For example:
MyTable .setDefault(ReadWrite::write);
-
Reference the individual fields in the table. For example:
AccountNumber = MyTable .accountNo;
The system creates a variable. Its name is the same as the table's that is used as a data source, but is postfixed with "ds." This enables you to reference properties and methods on the form data source (as opposed to the table itself), as shown in the following example.
MyTable_ds .research();
MyTable_ds .validateWrite();
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.