Friday, 21 November 2014

Getting Table Fields in AX 2012

Ax 2012 Job to get Table fields

static void TableObjects(Args _args)
{
    DictTable   d = new DictTable(tableNum(AccountantLogisticsLocation_BR));
    int         i;
    int         cnt = d.fieldCnt();
    str         nameForLookup;
    FieldId     fieldid = d.fieldNext(0);;


    for (i = 1; i <= cnt; i++)
    {
        if (!d.isDefaultData())
        {
            nameForLookup = d.fieldName(fieldid);
            if (d.fieldSqlDefault(fieldid))//skip default table fields
            {
                info(nameForLookup);
            }
            else
            {
                continue;
            }
            fieldId = d.fieldNext(fieldId);

        }

    }
   
}

No comments:

Post a Comment

Best Practices for Troubleshooting Application Issues in D365 and Power Platform

When facing application issues, it’s important to systematically troubleshoot before reaching out for support.  Follow these steps to ensure...