locked
JavaScript onSave / before save/ save result RRS feed

  • Question

  • Hi, I've been playing with the form onSave event in 2013. Attaching a function to this only appears to do anything AFTER the form is saved. Is it possible to attach a pre-save event somehow?

    function beforeSave(){

    alert("You're trying to save me. I'm going to do some stuff.");

    }

    function onSave(){

    alert("I've been saved.");

    }

    Thanks!

    Tuesday, October 29, 2013 10:29 AM

All replies

  • onSave script should process before the main save operation as after your scripts are processed at clients end, CRM form will submit to server for main operation.

    There is a new feature of saving updated data in controls(AutoSave) as soon as you change focus to some other control, are you having issues because of that? Disable that feature and check again.

    

    - Arvind

    Tuesday, October 29, 2013 10:50 AM
  • Hi, thanks for the response. Autosave is disabled, so the user has to click the save button. I've registered the onSave event in the form to a simple alert function and it only gets fired if the save succeeds?

    Tuesday, October 29, 2013 11:27 AM