I am having some trouble with a spawn script. I am spawning an item but the Multi select pick list content in not coming over.
The Item that I am spawning from has a multi select pick list on it and a matching multi select pick list exists on the item to be spawned. I would like the selections from the spawniung item to populate the list on the spawned item.
Does anyone have any pointer on how i can do this?
Thanks
I ran into this early on and have used it ever since, don't know if there is a better way or not.
The multi select field is an array and as far as I know you can't make an array equal another array. You must step through the source array (multi select field) and build the target array (multi select field) using the new properties field
I.E.
for ( i in source.field)
{
newProperties.targetfield(i) = sourcefield(i)
}
Not sure if the syntax is correct but this has worked for me
BD
Hi ihadden,
Based on your post, it seems that you might have forgotten to create a link back from workspace B to workspace A.
Here is a simple script that I wrote that will spawn a Task record from Project Record. As you can from the script, I have Bold and underline the 2 lines of script that will create a link back to Project Record
I hope this helps...
thank you,
Trung
if(item.SPAWN_TASK_WS !== null){
var newProperties = [];
newProperties.PROJECT_LINK = item.descriptor.descriptor;
createNewItem('WS_PM1_TASK_MANAGEMENT', newProperties);
if(newItem !== null){
item.SPAWNED_TASK_LINK = newItem;
}
}