Alfasith AX

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

Tuesday, April 12, 2022

Iterate the Error/ info log using Enumerator in AX 2012/ D365 F&O

Hi,


 SysInfologEnumerator sysInfologEnumerator;

    SysInfologMessageStruct sysInfologMessageStruct;

    Exception exception;

    checkFailed("Warning Msg");

    error("Error MSG");

    info("Info Msg");

    sysInfologEnumerator = SysInfologEnumerator::newData(infolog.cut());

    

    while (sysInfologEnumerator.moveNext())

    {

    sysInfologMessageStruct = new SysInfologMessageStruct(sysInfologEnumerator.currentMessage());

    exception = sysInfologEnumerator.currentException();

    info(strFmt("Msg type: %1; Message: %2",

        exception,

        sysInfologMessageStruct.message()));

    } 


Regards,

MAI

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