Sunday, October 31, 2021

Macros in D365 FO

A macro is a variable known to the precompiler. The variable can have a value that is a sequence of characters, but it is not required to have a value.

class GITS_Test
{
    public static void main(Args _args)
    {
        HcmWorker   HcmWorker;
        #localmacro.selectWorker
        select * from HcmWorker
        #endmacro

        #localMacro.whereClause
        where %1.PersonnelNumber == %2
        #endmacro

        #selectWorker
        #whereClause(HcmWorker,'001113');
        Info(strFmt("%1",HcmWorker.name()));
    }
}