AnsweredAssumed Answered

how to script assigning new datalist item

Question asked by spazur on Feb 9, 2012
Latest reply on Feb 10, 2012 by spazur
I am new to Alfresco, doing a proof-of-concept actually.  I've been tasked with exploring the scripting capabilities and have run into something that I cannot get working.

I have a script that is creating a new datalist item using the out-of-the-box advanced task list.  I have everything working except getting someone into the assignee field.  My approach has been a lot of trial and error so far with most of the things I've done, and I'm out of trials for this one.  I've tried a few different ways to get the assignee set with no success.  I'm sure this is something simple, and any help is greatly appreciated.

Also, is there any sort of script reference manual available?

Thank you

var testList = companyhome.childByNamePath("Sites/XXXsiteXXX/dataLists/506e9944-2785-4a48-82d8-8c42750e527c");
    // note: no error checking, or seeing if dataLists in general or this particular one already 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;
// THIS IS IT: testEntry.assocs["dl:taskAssignee"] = people.getPerson("joeschmoe");
testEntry.properties["dl:taskPriority"] = "High";
testEntry.properties["dl:taskStatus"] = "Not Started";
testEntry.save();

Outcomes