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

Author: Debajit

I am a Dynamics CRM Most Valuable Professional (MVP) with 10 years of experience in Microsoft .NET Technologies and 7 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side. Currently the face of XrmForYou.com with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through XrmForYou.com Author of multiple tools on codeplex including the 'Role Based Views' and 'CRM-Sharepoint Metadata manager & Attachment Extractor' which are available for commercial use under XrmForYou.com For consulting/ training, drop me a note at info@xrmforyou.com or visit our website www.xrmforyou.com

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s