Creating an editor template
Editor templates allow developers to reuse commonly used blocks of code. Dynamics AX provides a number of out of the box code templates for creating construct(), main()
, and parm()
methods, various statements such as if, else, switch
, code comments, and others. The existing templates can also be modified, or new templates can be created.
In this recipe, we will create a new code template for the find()
method, which is normally created on most of the tables. The template will only be available for table methods and will automatically detect the current table's name and use its primary key to determine the method's arguments.
How to do it...
Carry out the following steps in order to complete this recipe:
1. In the AOT, locate the
xppSource
class and create a new method with the following code:public Source findMethod(TableName _tableName) { str method; DictTable dictTable; DictIndex dictIndex; DictField dictField; FieldName fieldName; DictType dictType; DictEnum...