locked
How to use callback of Xrm.Page.data.entity.save RRS feed

  • Question

  • Hi there,

    SDK states that there is a callback returned after calling Xrm.Page.data.entity.save. Any idea how to use this callback object?

    Basically, the form does not save if there is any missing value in mandatory field. So, I need to know whether the record has successfully saved or not.

    In CRM 2015 Online, the onFormLoad script will re-execute after the record is saved so I can check using getFormType() but there seems to be a bug in the OnPremise version.

    Thanks,

    Henri


    • Edited by Henri_L Wednesday, June 3, 2015 3:27 AM
    Wednesday, June 3, 2015 3:23 AM

Answers

  • Found it in SDK. This content should have been added to the function reference page.

    Xrm.Page.data.save().then(
    function(){
    Xrm.Utility.alertDialog("Record saved");
    },
    function(error){
    Xrm.Utility.alertDialog(error.message);
    });

    • Marked as answer by Henri_L Wednesday, June 3, 2015 6:19 AM
    Wednesday, June 3, 2015 6:19 AM