Axapta 如何读取表中列的每个值

Axapta 如何读取表中列的每个值,axapta,x++,Axapta,X++,使用x++如何创建作业以读取Microsoft dynamics AX 2009表中列的每个值?一种可能性:在AOT(Ctrl-D)中,右键单击作业,然后选择新作业。在新窗口中输入以下内容(使用要读取的正确表名和列名): 但是还有其他一些方法:此代码将显示记录的所有列值 static void Job1(Args _args) { DictTable dictTable = new DictTable(tableNum(CustTable)); DictField dic

使用x++如何创建作业以读取Microsoft dynamics AX 2009表中列的每个值?

一种可能性:在AOT(Ctrl-D)中,右键单击作业,然后选择新作业。在新窗口中输入以下内容(使用要读取的正确表名和列名):


但是还有其他一些方法:

此代码将显示记录的所有列值

static void Job1(Args _args)
{
    DictTable   dictTable = new DictTable(tableNum(CustTable));
    DictField   dictField;
    int         counter, fieldId;

    CustTable   custTable;
    anytype     value; 

    select firstonly custTable;

    for (counter = 1; counter <= dictTable.fieldCnt(); counter++)
    {
        fieldId = dictTable.fieldCnt2Id(counter);
        dictField = new DictField(tableNum(CustTable), fieldId);

        if (!dictField.isSystem())
        {
            value = custTable.(fieldId);
            if(value)
            {
                info(strFmt('%1 = %2', 
                            dictField.label(),
                            any2str(value)));
            }
        }
    }
}
static void Job1(Args\u Args)
{
DictTable DictTable=新DictTable(tableNum(CustTable));
DictField-DictField;
int计数器,fieldId;
可储存的可储存的;
任意类型值;
选择firstonly custTable;

对于(counter=1;counter只是一个轻微的修改,取出
any2str
以使我的表正常工作:

strFmt(“%1=%2\r\n”,dictField.label(),value);

static void Job1(Args _args)
{
    DictTable   dictTable = new DictTable(tableNum(CustTable));
    DictField   dictField;
    int         counter, fieldId;

    CustTable   custTable;
    anytype     value; 

    select firstonly custTable;

    for (counter = 1; counter <= dictTable.fieldCnt(); counter++)
    {
        fieldId = dictTable.fieldCnt2Id(counter);
        dictField = new DictField(tableNum(CustTable), fieldId);

        if (!dictField.isSystem())
        {
            value = custTable.(fieldId);
            if(value)
            {
                info(strFmt('%1 = %2', 
                            dictField.label(),
                            any2str(value)));
            }
        }
    }
}