0

Dynamics AX 2012 – Update data progress bar

This job example will explain the use of SysOperationProgress class;

static void DEV_progress_example(Args _args)
{
 int i;
 #AviFiles
 
 SysOperationProgress progress = new SysOperationProgress();
 
 progress.setCaption('Processing something please wait'); /* Caption of the progress bar */
 progress.setAnimation(#AviUpdate); /* You can set different animations */
 progress.setTotal(100); /* Set total to keep progress of the progress bar (this case total records) */

 for (i=1;i<100;i++)
 {

 try
 {
 /* Setting the count on the progress bar */
 progress.setCount(i, 1);
 sleep(100); /* Sleep to demonstrate the progress bar */
 /* insert logic here */ 
 }
 catch
 {
 /* Some error handling */
 }
 }
}

jack

Leave a Reply