Wednesday, March 29, 2017

AX 2009 2012 - Get the Last used values from SysLastValue table using X++ - AX2009 AX2012

Below job is used to retrieve the Last used values for all users from the SysLastValue table. Here I have used the ReqTransPoMarkFirm class to get the last used values, you can change it to your class and try.


static void retreiveAllUserLastValues(Args _args)
{
    container                   value;
    ReqTransPoMarkFirm          caller;
    anytype                     aty;
    Userinfo                    userinfo;
    ;

    while select userinfo
    {
        caller = new ReqTransPoMarkFirm();
        value = classfactory.lastValueGet(caller.lastValueDataAreaId(),
                                          userinfo.id,
                                          caller.lastValueType(),
                                          caller.lastValueElementName(),
                                          caller.lastValueDesignName());
         aty = conPeek( value,8);
         info(Strfmt("%1--%2--%3",userinfo.id,userinfo.name,aty));       
    }

}
  

No comments:

Post a Comment