web
You’re offline. This is a read only version of the page.
close
Skip to main content
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

I have the same question (0)
  • Sacha Kircev Profile Picture
    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 ?

  • botten Profile Picture
    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
    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.

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans