Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Time remaining value in progress bar

Posted on by

Hi Experts,

I am using progress bar & only issue i have is that it shows incorrect time remaining. Please refer to pic & code below & suggest a fix so as to ensure that it shows correct time remaining values.

pastedimage1603985580562v2.png

protected  void processMyFile()
{
    SysOperationProgress importProgress = new SysOperationProgress();
    #AviFiles
    int cR,tR;

    importProgress.setCaption('Importing');
    importProgress.setAnimation (#AviTransfer);
    importProgress.setTotal(500);
    tR = my logic which gets total numbe of records;
        
    for (cR= 1; cR < tR ;cR  )
    {

        this.myImportProcess();
        importProgress.setText(strfmt('Importing record num %1 of total records to be imported %2',cR,tR));
        importProgress.setCount(counterOfRecordRows);
                    
    }// for ends

}

Thanks

Mav

  • Verified answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,089 on at
    RE: Time remaining value in progress bar

    Hi Mav,

    The estimated time is calculated based on the pace of count increment for progress. Maybe you can get a more precise time if you will use incCount method after each imported row instead of setCount.

    Also, why do you use constant 500 instead of real total count "tR" in SetTotal?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans