I am simply grabbing the DCR mod date and saving it to the DCR onSave and I am getting the error "Save was unsuccessful. Invalid category/type null was received.". To be honest I have even tried to just use a simple system date in javascript and that doesn't work here either. Here is the code:function init() { IWEventRegistry.addFormHandler("onSave",setModDate); IWEventRegistry.addFormHandler("onGenerate",getURL); } function setModDate () { var dcrModDt = IWDCRInfo.getModificationDate(); IWDatacapture.getItem("/policy/Metadata/lifecycle/modify").setValue(dcrModDt); return true; } function getURL () { var dcrURL = IWPageGeneration.getOutputFile (); IWDatacapture.getItem("/policy/Document Type/link/XML_URL").setValue(dcrURL); return true; } init();The function to get the generated page path works fine... Not sure what is wrong here.. The date does display in the textfield on the template, it just won't save.
I am simply grabbing the DCR mod date and saving it to the DCR onSave and I am getting the error "Save was unsuccessful. Invalid category/type null was received.".
If I comment out var dcrModDt = IWDCRInfo.getModificationDate(); it works fine. I can even put a value into the dcrModDt variable and it works great. Just seems weird.
I also wonder if you have a chick/egg problem. You need the modification date, so you try to read it, but you will be reading the old mod date, not the new mod date (now). Or you need to do something like save, get mod date, update DCR field, save again. You may be better off doing save, read mod date, run callserver to set EA with the mod time/date.
function setModDate () { var dcrModDt = Date(); IWDatacapture.getItem("/policy/Metadata/lifecycle/modify").setValue(dcrModDt); return true;}