Hello,
First, DFFS is great.
Looking for some help on adding a save function to this script below.
Currently I have a button in a DFFS form that calls a javascript which inserts the userID and the date into some R/O fields in the form. It works great. The issue is if a user edits any field in the form before they click the approve button, the changes are not saved. I tried adding presave and save however it didn’t work.
appreciate any help.
here is the script:
function myAIApproveFunction(){
var data = {}, today = new Date(), res;
data.ApprovalName = _spPageContextInfo.userId;
data.ApprovalDate = today.getFullYear()+”-“+(today.getMonth()+1)+”-“+today.getDate()+” 06:00:00″;
res = spjs_updateItem({“listName”:_spPageContextInfo.pageListId,”id”:spjs.dffs.data.thisItemID,”data”:data});
if(res.success){
location.href = location.href;
}else{
alert(res.errorText);
}
}