How to: Add Data
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
You can add data to Microsoft Dynamics AX. You can also modify data when you import and export the data.
Use the Table browser form to update data in individual tables. To access the form, in the AOT right-click a table, click Add-Ins, and then click Table browser.
Add Data
This section describes how to use table definition groups to export and import data.
Create a table definition group by doing the following:
Click Administration > Periodic > Data export/import > Definition groups.
Press CTRL+N, or click the New menu button.
This displays the Create table definition group form.In the General tab, type a unique name for the definition group in the Definition group text box.
Enter a short description into the Description text box.
Select your preferred check boxes on the Options tab.
On the Include table groups tab you can make other definition groups be a part of your new definition group.
Click the OK button to create your definition group.
The Definition groups form is displayed.
On the Definition groups form, select the check box next to your definition group.
Click the Select tables menu.
Select a check box for every table that you want in your definition group.
On the row for each table you select, you can also select check boxes for applying criteria or specifying related tables.
Click the Close button. A Tables form is displayed in which you can see all the tables that are associated with your definition group.
You can use the Tables form to choose which fields you want involved in exports and imports.Back at the Definition groups form, you can click menus for export or import.
Modify Data During Import and Export
Create an X++ class that extends the SysDataTableCtrl Class class, as shown in the following example.
public class SysDataTableCtrl_Address
extends SysDataTableCtrl
{}Override the SysDataTableCtrl.mustCtrlExport and SysDataTableCtrl.mustCtrlImport methods to return true, as shown in the following example.
public boolean mustCtrlExport()
{ return true; }Override other methods as needed.
Add the class you created in step 1 to the SysDataTableCtrl::construct method, as shown in the following example.
client server static SysDataTableCtrl construct(DictTable dt)
{
switch (dt.id())
{
case tablenum(UserInfo):
return new SysDataTableCtrl_UserInfo(dt);
case tablenum(SysUserInfo):
return new SysDataTableCtrl_SysUserInfo(dt);
case tablenum(Address):
return new SysDataTableCtrl_Address(dt);
}
return new SysDataTableCtrl(dt);
}
See also
Manipulation of Data in Tables
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.