var futureDate = new Date(); 
futureDate.setDate(futureDate.getDate() + 7);
var currentDate = new Date();
var testList = companyhome.childByNamePath('Sites/sitenamegoeshere/dataLists/b2c74e68-1ccf-494e-83a6-b36049d2607a');
// note: no error checking, or seeing if dataLists or this particular datalist even exists 
var testEntry = testList.createNode(null, 'dl:task');
testEntry.properties['cm:title'] = document.name;
testEntry.properties['cm:description'] = document.name;
testEntry.properties['dl:ganttStartDate'] = currentDate;
testEntry.properties['dl:ganttEndDate'] = futureDate;
testEntry.properties['dl:taskPriority'] = 'High';
testEntry.properties['dl:taskStatus'] = 'Not Started';
testEntry.save();
testEntry.createAssociation(people.getPerson('assigneeusername'),'dl:taskAssignee');
文档更新时间: 2020-02-16 16:49   作者:凌云文档