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 :
Dynamics 365 Community / Blogs / The Dynamics 365 Library / AX 2012 - How to show progr...

AX 2012 - How to show progress bar for lengthy operations

Faisal Fareed Profile Picture Faisal Fareed 10,796 User Group Leader
Below is a very simple example to show progress bar in a job - this logic can be used anywhere in your logic.

static voidSysOperationProgress_PrimeNumber(Args _args)
{
    #avifiles
    boolean                 checkPrime, _showProgess = true;
    SysOperationProgress    progressBar = newSysOperationProgress();
    int                     counter, out;
    ;
    counter = 1;
    out = 1000;
    while(counter < out)
    {
        checkPrime = ((counter mod 2)!=0 && (counter mod3) !=0);

        if(checkPrime)
        {
            info(strfmt("its a prime number %1",counter));
        }
        progressBar.setCaption(strfmt("Generating the prime number for %1",counter));
        progressBar.setAnimation(#aviUpdate);
        progressBar.setText(strfmt("Processing %1 out of %2",counter,out));
        counter++;
    }
}



This was originally posted here.

Comments

*This post is locked for comments