locked
Refresh Form after saving (Javascript) RRS feed

  • Question

  • How do I refresh a form after it has successfully saved the data? Currently I have the following and it gives me a webmessage "Your Changes have not been saved". 

    Xrm.Page.data.entity.save();

    Xrm.Page.data.refresh();

    Friday, May 26, 2017 3:57 PM

All replies

  • Check your scripts. It looks like you are setting a field value on save event which causes this message.

    Also you can use the following script to refresh the form:

    var currentRecordIdString = parent.Xrm.Page.data.entity.getId();
    
    var currentRecordId = currentRecordIdString.replace("{", '').replace("}", '');
    
    
    
    Xrm.Utility.openEntityForm("entitylogicalname", currentRecordId);



    Sachith Chandrasiri

    Monday, May 29, 2017 12:29 AM