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!

Advertisements

2 thoughts on “Reload an entity form in Dynamics CRM 2013/ 2015

    1. Hi Joanny,
      Thanks for reading my blog post.
      Could you give me some more detail. When are you trying to reload the form.
      In the entity form you will always get Xrm.Page.data.entity.getId() except if the form loads in the create mode.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s