Skip to main content

Notifications

Announcements

No record found.

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
    Sacha Kircev 905 on at
    Re: Re: Re: Best practise automated

    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.

     

  • botten Profile Picture
    botten 320 on at
    Re: Re: Best practise automated

    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
    Sacha Kircev 905 on at
    Re: Best practise automated

    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 ?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans