Sunday, 2 April 2017

MS CRM - Refresh Form - #JSTip2



In the latest version of CRM, there were situations where we need to refresh the whole form instead of refreshing date using Xrm.Page.data.refresh.

To achieve conventional refresh, we can use openEntityForm available in Xrm.Utility. This method reopens the record in a conventional way which is equivalent to full refresh.

Code snippet for the same is as follows


function refreshForm() {
        Xrm.Page.data.setFormDirty(false);
        Xrm.Utility.openEntityForm(Xrm.Page.data.entity.getEntityName(), Xrm.Page.data.entity.getId());
    }

No comments:

Post a Comment