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 :
Microsoft Dynamics CRM (Archived)

How to force a sub-grid to refresh using javascript?

(0) ShareShare
ReportReport
Posted on by

I have added a custom button to the command bar on the sub grid for records associated with the current record.  So I load up a particular record, use the sitemap tiles to view the sub-grid for some associated records, and click the new button on the command bar.  The button fires some javascript function that in turn triggers updates on the records listed in the sub-grid.  What I would like to do is force the sub-grid to refresh after the updates instead of clicking the refresh icon on the sub-grid manually.  Thanks for the help.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Royal King Profile Picture
    27,686 on at
    RE: How to force a sub-grid to refresh using javascript?

    below script will refresh the subgrid

    var subgrid = Xrm.Page.ui.controls.get("subgridname");

    subgrid .refresh();

    Below post gives detailed information how to refresh the subgrid from ribbon button

    http://a33ik.blogspot.com/2012/11/how-to-refresh-associated-or-subgrid.html

  • AK350 Profile Picture
    on at
    RE: How to force a sub-grid to refresh using javascript?

    Wow, that's easy. I was looking through the SDK doc and searching online and didn't find that but I figured I had to be missing something.  Thank you!

  • Srikanth Reddy Profile Picture
    135 on at
    RE: How to force a sub-grid to refresh using javascript?

    Thanks for your response and I have already tried with the below code in onload of the form but still i am facing the same issue for the first time of loading the page.

    var subgrid = Xrm.Page.ui.controls.get("subgridname");

    subgrid .refresh();

  • Suggested answer
    Kathan Profile Picture
    20 on at
    RE: How to force a sub-grid to refresh using javascript?

    try calling this function on main form load or save event

    function refresh(executionContext) {

       var formContext = executionContext.getFormContext();

         formContext.ui.refresh();

    }

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Wayne Walton Profile Picture

Wayne Walton 2

#2
Good.Panos Profile Picture

Good.Panos 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans