Showing posts with label Progress Bars in Ax 2012. Show all posts
Showing posts with label Progress Bars in Ax 2012. Show all posts

Monday, 18 January 2016

Progress Bars in Ax 2012

static void SysOperationProgress_PrimeNumber(Args _args)
{
    #avifiles
    boolean checkPrime,_showProgess = true;
    SysOperationProgress progressBar = new SysOperationProgress();
    int counter,num;
    ;
    counter = 1;
    num = 1000;
    while(counter < num)
    {
        checkPrime = ((counter mod 2)!=0 && (counter mod 3) !=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.setAnimation(#AviFindFile);
        //progressBar.setAnimation(#AviPrint);
        progressBar.setAnimation(#AviTransfer);
       
        progressBar.setText(strfmt("Processing %1 out of %2",counter,num));
        counter++;
    }
}