What's wrong with this script? I'm getting this error - Script Error - One of the scripts for this record has caused an error. For more details, download the log file.
function autosaveWhenFieldIsDirty(formContext)
{
var isFieldDirty = formContext.getAttribute("logdate").getIsDirty();
var saveOptions = {
saveMode: 70
};
if(isFieldDirty == true)
{
formContext.data.save(saveOptions).then(
function (success) {
console.log(success);
},
function (error) {
console.log(error);
}
);
}
}