Alfasith AX

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

Friday, January 25, 2019

Getting the field Name in Table modified field event handler in D365

Hi,

can be achieved by args.getArgNum(1);

class XXXXCustTable_EventHandler
{
    /// <summary>
    ///
    /// </summary>
    /// <param name="args"></param>
    [PostHandlerFor(tableStr(CustTable), tableMethodStr(CustTable, modifiedField))]
    public static void CustTable_Post_modifiedField(XppPrePostArgs args)
    {
        CustTable               custTable   =  args.getThis() as CustTable;

        switch (args.getArgNum(1))
        {
            case fieldNum(custTable, CustGroup):
                if(!CustTable.OverrideSpecialMarginCode)
                {
                    custTable.SpecialMarginCode = CustGroup::find(
                                  custTable.CustGroup).SpecialMarginCode;
                }
                break;
        }
    }

}
Thanks,

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...