locked
CRM 2013 online - Reload/Refresh the entire record on save hit in edit mode RRS feed

  • Question

  • Hello All,

    CRM 2013 online: Reload the entire record on save hit in edit mode. There are around 5 different entities where I would like to reload the entire record on click on save button, at the bottom right corner in CRM 2013 online. Also, want to reload the lead record when user clicks on Qualify button. Please advise.


    Thanks, Ankit Shah


    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    Thursday, October 30, 2014 10:28 AM

Answers

  • Hi Ankit,

    Please refer this post. It's debatable whether it's supported or not.


    Regards, Saad

    Thursday, October 30, 2014 11:44 AM

All replies

  • HI Ankit,

    You can use On Save event and write javascript to reload the page.

    window.location.reload(true);


    Regards, Saad

    Thursday, October 30, 2014 10:36 AM
  • Hello Saad,

    Thank you for the quick response. Is this line of code supportive for CRM?


    Thanks, Ankit Shah


    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html


    Thursday, October 30, 2014 11:03 AM
  • Hi Ankit,

    Please refer this post. It's debatable whether it's supported or not.


    Regards, Saad

    Thursday, October 30, 2014 11:44 AM
  • Hi Mohd, 

    The onSave event fires before the update event has actually been submitted to the server; thereby, allowing us to cancel the save if needed.  What I think Ankit is asking for is more along the lines of something like an onAfterSave event that he can hook into and then refresh the page.  Ankit if this is correct, I'd look at adding an onChange handler to the modifiedon attribute.  This will give you a means to create a pseudo onAfterSave event, which then allow you to reload the page.  See below for an example

    //Ensure 'modifiedon' attribute is present on form
    if (Xrm.Page.getAttribute("modifiedon")) {
      Xrm.Page.getAttribute("modifiedon").addOnChange(function (ExecContext) {

        //Run below line if you want to go through a page reload that'll execute the onLoad event  
        window.location.reload(true);
        
        //Run this line if you just want to refresh all the data on the form
        //Xrm.Page.data.refresh(false);
      })
    };


    Thursday, October 30, 2014 11:45 AM