Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Thursday, November 15, 2018

Job to list all the fields in particular table in D365

Hi,


class AlfasithTableFieldList
{       
    /// <summary>
    /// Runs the class with the specified arguments.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {

        TableName           tableName = 'SalesTable';
        SysModelElement     sysModelElementTables;
        SysModelElement     SysModelElementFields;
        DictField           dictField;
        ;
        while select    sysModelElementTables
            where   sysModelElementTables.ElementType               == UtilElementType::Table       &&
                    sysModelElementTables.Name                      == tableName
            join SysModelElementFields
                where   SysModelElementFields.ElementType           == UtilElementType::TableField  &&
                        SysModelElementFields.ParentModelElement    == sysModelElementTables.RecId
        {
            dictField = new DictField(sysModelElementTables.AxId, sysModelElementFields.AxId);
            print dictField.name();
        }
    }

}

Regards,

No comments:

Post a Comment

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...