Assign person custom field with a person
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2013 07:01 PM
During a workflow progression I would like to set a custom type persons field to different people.
The "sop:sourceSubPerson" is our custom field associated to the parent folder of the document. However this line of code is not working.
parentFolder.properties["sop:sourceSubPerson"] = people.getPerson("Bautista");
Any input would be appreciated.
The "sop:sourceSubPerson" is our custom field associated to the parent folder of the document. However this line of code is not working.
parentFolder.properties["sop:sourceSubPerson"] = people.getPerson("Bautista");
Any input would be appreciated.
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2013 03:06 PM
Hello,
please keep in mind that any changes to properties in a JavaScript-based action / script will only be saved when you explicitly call the save() method on the ScriptNode.
In your case:
<blockcode>
parentFolder.properties["sop:sourceSubPerson"] = people.getPerson("Bautista");
parentFolder.save();
</blockcode>
Regards
Axel
please keep in mind that any changes to properties in a JavaScript-based action / script will only be saved when you explicitly call the save() method on the ScriptNode.
In your case:
<blockcode>
parentFolder.properties["sop:sourceSubPerson"] = people.getPerson("Bautista");
parentFolder.save();
</blockcode>
Regards
Axel
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2013 12:10 PM
Hi AFaust,
Yes, I did call a save method just didn't include it in the code sample. I think the problem with the custom field (sop:sourceSubPerson) is that it is an association to the cm
erson class. When I view the node, I see that the sop:sourceSubPerson property contains the name. However, it does not appear in the Share interface.
When I populate the field through the share interface and view the node, the Association of the node is populated with the person target reference. So am I to assume I need to be saving an association? And how would I do that?
Thanks so much!!
Mike T
Yes, I did call a save method just didn't include it in the code sample. I think the problem with the custom field (sop:sourceSubPerson) is that it is an association to the cm

When I populate the field through the share interface and view the node, the Association of the node is populated with the person target reference. So am I to assume I need to be saving an association? And how would I do that?
Thanks so much!!
Mike T
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2013 02:12 PM
After surfing the forums below was the solution I emulated, hope it helps others. My custom field sop:sourceSubPerson was an association to cm
erson so an update to properties method did not do anything. An association must be created in the node containing the custom field and that was done by the below.
var parentFolder = document.parentAssocs["cm:contains"][0];
var person = people.getPerson('Bautista');
parentFolder.createAssociation(person, "sop:sourceSubPerson");
parentFolder.save();

var parentFolder = document.parentAssocs["cm:contains"][0];
var person = people.getPerson('Bautista');
parentFolder.createAssociation(person, "sop:sourceSubPerson");
parentFolder.save();
