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
try calling this function on main form load or save event
function refresh(executionContext) {
var formContext = executionContext.getFormContext();
formContext.ui.refresh();
}
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();
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!
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,151 Super User 2024 Season 2
Martin Dráb 229,993 Most Valuable Professional
nmaenpaa 101,156