关于AX的临时表

AX中临时表分两种类型:

  1。如果AOT事先有定义一个表的临时表,那么就直接使用这个表的临时表。

static void TableTmpInsertRecord(Args _args)
{
    TmpCustLedger custTmpLedger;
    ;
    custTmpLedger.AccountNum = '1000';
    custTmpLedger.Name = 'NameValue';
    custTmpLedger.Balance01 = 2345000;
    custTmpLedger.insert();
}
2。如果AOT中没有定义临时表,则可用A++来声明一个临时表。
static void CopyPersistedTableToTemp(Args _args)
{
    CustTable custTable;
    CustTable custTmpLedger;
    ;
    custTmpLedger.setTmp();
    custTable.recordLevelSecurity(true);

    while select custTable where custTable.City == 'Toronto'
    {
        custTmpLedger.data(custTable.data());
        custTmpLedger.doInsert();
     }
}

原文地址:https://www.cnblogs.com/perock/p/2000651.html