Sunday, April 12, 2020

Pack UnPack in Dialog Form in Ax 2012

In class declaration write this

//in the start
#define.CurrentVersion(2)



//in the end
#localMacro.CurrentList
        fromDate,
        toDate,
        fromDataAreaId,
        toDataAreaId,
        generalType,
        mainAccounts,
        division
#endMacro







Make this method in the dialog form

container pack()
{
    return [fromDate,toDate,fromDataAreaId,toDataAreaId,generalType,mainAccounts,division];

}


Make this method in the dialog form
boolean unpack(container _packedValues)
{
    [fromDate,toDate,fromDataAreaId,toDataAreaId,generalType,mainAccounts,division] = _packedValues;
    return true;
}