Reload an entity form in Dynamics CRM 2013/ 2015

From CRM 2013 onwards, many a times we need to reload an entity form since from CRM 2013 after saving of the record, the entire page does not refresh. And frequently to do this, I have come across use of window.location.reload method to do the same.

Off course there are ways to asynchronously update the data section or the ribbon section using the Xrm.Page.data.refresh(true|false) and Xrm.Page.ui.refreshRibbon() respectively. But if at all, your intention is to reload the entire form, you can do so using the Xrm.Utility.openEntityForm method.

In the section where you need to reload the page, call the above method. For example -  to reload an account record use the following code.

Xrm.Utility.openEntityForm(“account”, Xrm.Page.data.entity.getId());

Hope this helps!