web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Best practise automated

(0) ShareShare
ReportReport
Posted on by 320

L.S.

Please, I need some help with this job. Can you see why I don't get a result for error or warnings?

 

static void BestPractiseJob(Args _args)
{
    SysBPCheck          sysBPCheck;
    TreeNode            node;

    SysCompilerOutput   sysCompilerOutput;

    #AOT
    ;
    node = treenode::findNode(#ClassesPath);
    node = node.AOTfindChild("SalesFormLetter");

    sysCompilerOutput = infolog.compilerOutput();
    SysBPCheck::checkTreeNode(node);

//    sysCompilerOutput.startCompilationContext();
//    sysCompilerOutput.endCompilationContext();

    info(strFmt("Message count: %1", sysCompilerOutput.bestPracticesCount()));
    info(strFmt("Error count: %1", sysCompilerOutput.errorCount()));
    info(strFmt("Warning count: %1", sysCompilerOutput.warningCount()));
}

*This post is locked for comments

  • Sacha Kircev Profile Picture
    905 on at

    Hi,

    your job works, it's only not displaying errors or warnings because SalesFormLetter

    class does not have errors or warnings at compilation in your environment.

    Have you tried your job on a class that does not compile ?

  • botten Profile Picture
    320 on at

    Thanks for your reply,

    Yes I ran the job against a self made crappy class... All seems fine, though the error count and warning count remain zero. That can't be right....

    Do you know what the ...context means?

     

  • Sacha Kircev Profile Picture
    905 on at

    Hi,

     i noticed 2 things : your object sysCompilationOutput is not instanciated.

    i think you can try to create it manually and then use it as the input parameter

    of the infolog class called.

    The second thing is that you use the BP check, have you tried to actually

    compile the class via a call like node.AOTCompile() or something similar?

    I'm not sure but maybe code access permissions will be needed in the last case.

    Regards.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans