Refresh MSD form

Refresh-icon

When we need to refresh MSD CRM/365 form all the time, I mean whenever there is change on the record, the form has to refresh to populate new values. The workaround for this is, add ‘ModifiedOn’ field on the form and trigger below JavaScript function on change of it. 

function RefreshForm() {

    //Needed to set form dirty to false explicitly as it is not done by platform
    Xrm.Page.data.setFormDirty(false);

    var Id = Xrm.Page.data.entity.getId();
    Xrm.Utility.openEntityForm("EntityName", Id);

}

That’s it!!

Thanks!

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