Customer Engagement & Dynamics CRM Forum

 View Only
  • 1.  Auto Refresh

    Posted Feb 06, 2019 11:58 AM
    Is there a way to auto refresh a page after a certain amount of time? I current have business process that starts from an entity record, steps two moves to an activity record with the regarding set as the original entity, and then when that activity is complete, the business process takes you back to the regarding but does not "visually" move the business process bar to the next stage. In the background, the stage is moved, but you have to refresh the page. I'm look to have the page refresh after the stage is moved in the background or maybe have an alert the doesn't show a "move forward" button until the background process takes place, so you won't have to refresh.

    ------------------------------
    Tristan Holt
    CRM Administrator
    StoneMor Partners
    Trevose PA
    ------------------------------


  • 2.  RE: Auto Refresh

    Posted Feb 07, 2019 02:03 AM
    I'm not 100% clear on how you are moving stages - I'm assuming its a workflow or action? Based on this, I do not believe there is any way to refresh the page using server side code or workflow. You could use JavaScript for client side scripting but how will you know when the workflow is run. In my environment, I settled on client side notifications to remind them to refresh the page to update the BPF. This is a great resource to use D365 notifications. https://neilparkhurst.com/2015/11/02/javascript-notifications/

    ------------------------------
    Maxine Harwood
    Best Practice Software
    ------------------------------



  • 3.  RE: Auto Refresh

    TOP CONTRIBUTOR
    Posted Feb 07, 2019 06:07 AM
    Hi @Tristan Holt, when you say ​"In the background, the stage is moved", what field is being updated in the background?
    We've started using a workflow to use the Active Stage field from the BPF to update our Pipeline Stage field on the opportunity form so you may want to look into the Active Stage field if you aren't using it.

    ------------------------------
    Mark Aston
    Data Analyst
    Ordnance Survey
    Southampton, UK
    ------------------------------



  • 4.  RE: Auto Refresh

    Posted Feb 07, 2019 09:51 AM

    Tristan

    1.) Is there a way to auto refresh a page after a certain amount of time?

    Yes, but I don't recommend it.

    https://www.w3schools.com/jsref/met_win_settimeout.asp

    2.) I'm look to have the page refresh after the stage is moved in the background

    It might be better to use a progress bar, especially if you don't want the user to do anything else until the background process is done.

    I would display the progress bar to "lock" the screen and initiate an async call that queries the stage. Once I get a response back, that would trigger the page to refresh.

    Cheers!

     



    ------------------------------
    Rex Kenley Tan, MCP
    Akron OH
    https://www.youracclaim.com/users/rex-kenley-tan

    *Always be CURRENT with JavaScript & C#, NEVER be obsolete.

    DISCLAIMER: All views expressed on this site are my own and DO NOT represent the opinions of ANY entity whatsoever with which I have been, am now, or will be affiliated.
    ------------------------------



  • 5.  RE: Auto Refresh

    Posted Feb 07, 2019 09:58 AM
    Edited by Tristan Holt Feb 07, 2019 09:58 AM
    Rex,

    The progress bar would be ideal. How would I set that up?

    ------------------------------
    Tristan Holt
    CRM Administrator
    StoneMor Partners
    Trevose PA
    ------------------------------



  • 6.  RE: Auto Refresh

    Posted Feb 07, 2019 10:08 AM
    Open Progress Indicator using Xrm.Utility in Dynamics 365 v9.0
    Inogic remove preview
    Open Progress Indicator using Xrm.Utility in Dynamics 365 v9.0
    A few months back Microsoft has announced the release of Dynamics 365 v9.0 and has come up with many cool features. Where some of them are related to functionality while others are related to UI. Well! The list of newly added features is quite long though not exhaustive.
    View this on Inogic >


    ------------------------------
    Rex Kenley Tan, MCP
    Akron OH
    https://www.youracclaim.com/users/rex-kenley-tan

    *Always be CURRENT with JavaScript & C#, NEVER be obsolete.

    DISCLAIMER: All views expressed on this site are my own and DO NOT represent the opinions of ANY entity whatsoever with which I have been, am now, or will be affiliated.
    ------------------------------



  • 7.  RE: Auto Refresh

    Posted Feb 07, 2019 10:14 AM
    Rex,

    Is this only for Version 9 and above? If so, is there another solution for version 8.2?

    ------------------------------
    Tristan Holt
    CRM Administrator
    StoneMor Partners
    Trevose PA
    ------------------------------



  • 8.  RE: Auto Refresh

    Posted Feb 07, 2019 10:21 AM
    https://github.com/PaulNieuwelaar/alertjs

    ------------------------------
    Rex Kenley Tan, MCP
    Akron OH
    https://www.youracclaim.com/users/rex-kenley-tan

    *Always be CURRENT with JavaScript & C#, NEVER be obsolete.

    DISCLAIMER: All views expressed on this site are my own and DO NOT represent the opinions of ANY entity whatsoever with which I have been, am now, or will be affiliated.
    ------------------------------



  • 9.  RE: Auto Refresh

    Posted Apr 13, 2022 02:04 AM
    setTimeout() and setInterval() functions allow you to execute a piece of JavaScript code/function at a certain point in the future. setInterval repeats the call, setTimeout only runs it once.

    JavaScript setTimeout(expression, timeout); runs the code/function once after the timeout. It is a time based code execution method that will execute script only one time when the interval is reached, and not repeat again unless you gear it to loop the script by nesting the setTimeout object inside of the function it calls to run. If geared to loop, it will keep firing at the interval unless you call clearTimeout(). If you want something to happen one time after some seconds Then use setTimeout... because it only executes one time when the interval is reached.

    setTimeout(function() {
    console.log('Wait 3 seconds and I appear just once');
    }, 3000);

    setInterval(expression, timeout); runs the code/function repeatedly, with the length of the timeout between each repeat. It is a time interval based code execution method that has the native ability to repeatedly run specified script when the interval is reached. It should not be nested into its callback function by the script author to make it loop, since it loops by default. It will keep firing at the interval unless you call clearInterval(). If you want to loop code for animations or clocks Then use setInterval.

    setInterval(function() {
    console.log('Every 3 seconds I appear on your console');
    }, 3000)


    ------------------------------
    tony gruz
    MFC
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role