Alfasith AX

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

Saturday, November 17, 2018

cannot access a disposed object, Object name 'memory model provider has been already disposed


Hi,

Cannot access a disposed object,
Object name 'memory model provider has been already disposed

Prompts an error when you built the model you have.

Solution:

1. Full built all the model files.
2. Restart the IIS.
3. Rerun the VS.

Regards,

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,

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...