Refresh CRM Grid using JavaScript 

Learn how to refresh Dynamics 365 forms and views programmatically using JavaScript.

Share :

Refresh CRM Grid using JavaScript

Author

Picture of Bhavika Patel

Bhavika Patel

In Microsoft Dynamics 365, there are many occasions that you need to refresh either form or view programmatically using JavaScript. I will list down how you can achieve this in supported way.   

Home Page Grid refresh  

It is little tricky to refresh view programmatically. One of the common scenario where you need to do this is if you have a custom button on home page grid and would like to refresh view to automatically reflect the changes. There is a supported way to achieve this.   

Using Ribbon Workbench pass CRM Parameter ‘SelectedControl’ to your command’s Custom JS action, and then in JS function just use below line after all the processing is completed.   

Syntax 

selectedControl.refresh();  

Form Refresh 

As you are on form and you have access to form context, it is very easy to refresh form asynchronously without reloading the page as shown below 

Syntax 

formContext.data.refresh(save).then(successCallback, errorCallback);  

Parameter 

Name  Type  Required  Description  
save  Boolean  No  true if the data should be saved after it is refreshed, otherwise false.  
successCallback  Function  No  A function to call when the operation succeeds.  
errorCallback  Function  No  A function to call when the operation fails.  

Hope this helps to achieve your goal in supported way. 

Related Posts

Do You Want to Grow Sales – Without Growing the Organization? 

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.

Read More

Connect to Multi-factor enabled D365 Dataverse

Connect to Multi-factor Enabled D365 Dataverse/CDS Programmatically Using Certificates (Online 9.1) 

Connect programmatically using Certificates (Online 9.1) The more secure way to achieve S2S authentication.

Read More

Generate PDF Report in Dynamics CRM 365

Generate PDF Report in Dynamics CRM 365 

Learn how to generate PDFs from Dynamics 365 reports programmatically with JavaScript, including handling custom and OOB SSRS reports.

Read More

Connect to D365 CE Programmatically

Connect to D365 CE Programmatically without MFA/ On-Premise D365 CE

Learn how to create C# connection strings for Dynamics 365 on-premise and CDS online.

Read More

Contact Us

Leave your contact details here and we’ll get in touch

Get resource