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

Calculate ledger balance by dimension set in X++ in AX2012/Dynamics 365 FO

There are a variety of ways users can view balances in the general ledger. Some of the most common options are: 1. Trial balance 2. Financia...