We know how data. save work but in post, we will see how to perform further logic on successful save or failure of function
formContext.data.save(saveOptions).then(successCallback, errorCallback);
We have triggered a function on change of name, once the name is changed javascript will try to force save the form using below client API
formContext.data.save().then(function() { alert("Successfully Saved "); }, function() { alert("Something Went Wrong"); });
- We have a mandatory field on the lead, when we change the name and the mandatory field is empty alert msg will be empty.
- If Everything goes fine .then(function() { alert(“Successfully Saved “); }