Tuesday, October 21, 2014

Navision Progressbar Pseudocode


I would like to post this pseudocode so that I can refer it anytime and anywhere I want. after many years in Navision world, I feel that I need progressbar everytime I want to know the progress of the data processing. It's tedious action that I need to open my old database to find the codes again and again...... --<--<@


...

CurrTotal := 0;
TotalRecs := <TABLE>.COUNT;
ProgressBar.OPEN('<TITLE> #1#####' + ' / ' + FORMAT(TotalRecs) + '\' +
                 '<FIELD NAME 1>           #2#########'        + '\' +
                 '<FIELD NAME 2>           #3#########'        + '\' +
                 '<FIELD NAME 3>           #4#########'        + '\' +
                 '\@5@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@');
REPEAT

  //PROCESSING......

        
  CurrTotal := CurrTotal + 1;
  Progress := ROUND(CurrTotal/TotalRecs*10000, 1); //max limit = 10000
  ProgressBar.UPDATE(1, CurrTotal);
  ProgressBar.UPDATE(2, <TABLE>.<FIELD NAME 1>);
  ProgressBar.UPDATE(3, <TABLE>.<FIELD NAME 2>);
  ProgressBar.UPDATE(4, <TABLE>.<FIELD NAME 3>);
  ProgressBar.UPDATE(5, Progress);

UNTIL <TABLE>.NEXT = 0;


...


Name            DataTye

========================
Progress Integer
ProgressBar Dialog
TotalRecs Integer
CurrTotal Integer

No comments:

Post a Comment