Search This Blog

Monday, September 19, 2011

AX 2012 TempDB Tables

In Microsoft Dynamics AX, one type of temporary table is a TempDB table.

We call them TempDB tables because their TableType property value is TempDB. This value comes from the TableType::TempDB enum value. The TableType property value can be set at AOT > Data Dictionary > Tables > MyTempDBTable > Properties > TableType.

Only processes that run on the server tier can instantiate TempDB tables.

Following Sample will give the little picture about how to use the TempDb Tables

Create the Class with this main method and Run the class
server public static void main(Args _args)
    MyTempdb MyTempdb;
    CustTable custTable;
    TableType tableTypeEnum;
    str stringWork;
    info("Start of main.");
    MyTempdb;.AccountNum = "4004";
    MyTempdb;.AccountNum = "4005";
    tableTypeEnum = MyTempdb;.getTableType();
    stringWork = "MyTempdb.TableType is: " + enum2Str(tableTypeEnum);
    while select *
            from custTable
                JOIN MyTempdb;
                MyTempdb;.AccountNum == custTable.AccountNum
        stringWork = custTable.AccountNum
                + " , "
                + int2Str(custTable.MandatoryCreditLimit);

No comments:

Post a Comment

Thanks for visiting my blog,
I will reply for your comment within 48 hours.