web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Suggested answer

Refresh data in a step of a multi-step form

(0) ShareShare
ReportReport
Posted on by 58
I am using a MultiStep form (MSF) with a subgrid (list) and given the nature of the system, the data that the subgrid shows can change while the subgrid is displayed, and I have the need to refresh the current step of the subgrid, without moving away from it.

One proposal to refresh the subgrid is that you effectively use JavaScript to mimic a ‘click’ on of the sort columns of the subgrid and this causes a refresh and this is nearly correct. I use this script
 
var sortLink = document.querySelector('th a[href="#"]');
if (sortLink) {
    sortLink.click();
}

When the script runs, I have effectively sorted the CreatedOn date to ‘oldest’ at the top and as the screenshot shows, the new document 27, appears as it should, at the bottom.


However, if you click the ‘created on’ column sort again, then as the screenshot below shows, the new document disappears.


If we click on the ‘created on’ sort column, it re-appears. 

Has anyone any idea why this would happen? It seems near impossible to refresh the data in the current step without moving away from that step. I have tried creating hidden ‘save’ buttons and refreshing them via Javascript but it’s the same issue.
Categories:
I have the same question (0)
  • Suggested answer
    CU25102359-0 Profile Picture
    2 on at
    Refresh data in a step of a multi-step form
    Gametwist 
     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    51,550 Super User 2025 Season 2 on at
    Refresh data in a step of a multi-step form
     
    There a few reasons that it can unfortunately disappear temporarily.
     
    However what you really want is to actually trigger the refresh and then sort if you need, not use a sort to ... attempt to refresh as its not the same.
     
    $('.entity-grid').trigger('refresh');
    setTimeout(function () {
        var sortLink = document.querySelector('th a[href="#"]');
        if (sortLink) {
            sortLink.click();
        }
    }, SameValueHereToWaitInMilliseconds);
     

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • JBC777 Profile Picture
    58 on at
    Refresh data in a step of a multi-step form
    Michael,
     
    thansk for this but this is the same code as used above, just wrapped in a timer, and mine when deployed is in a timer, but i removed it for clarity. You are correct, 'eventually' everything gets sorted, and there are many references to Dataverse not always being 'realtime'.
     
    I am currently looking at moving away from the List Entity for the areas that need updates and workign with AG grid and Javascript becuase this way, i can control all aspects of the update.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 50 Super User 2025 Season 2

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 38 Super User 2025 Season 2

#3
Jerry-IN Profile Picture

Jerry-IN 30

Last 30 days Overall leaderboard