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!
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.
love it, but when the form reload the Xrm.Page.data.entity.getId() is empty. is not recognizing the save/update ??!!
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.