Dynamics 365 JavaScript Subgrid Refresh

1 Comment

Here we will go through an example of refreshing a Dynamics 365 subgrid using JavaScript.

Let’s say we want the Recent Opportunities subgrid of an Account to refresh after a user presses a button. We have a web resource with a button that will run some JavaScript code:

Edit the form to look up the name of the subgrid:

Now add the code to the JavaScript behind the button:

parent.Xrm.Page.getControl("accountopportunitiesgrid").refresh();

Note in running this from within Dynamics 365, e.g. a field change, we can use:

Xrm.Page.getControl("accountopportunitiesgrid").refresh();

Now, in a new window, create a new opportunity:

Click the Submit button. The JavaScript will run and refresh the subgrid:

 

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

One Response to Dynamics 365 JavaScript Subgrid Refresh

Leave a Reply

Your email address will not be published. Required fields are marked *