I am writing a script that is supposed to check if I have a relationship from a particular workspace.
How do I do that?
I have:
for (var i in item.relationships) {
>>> item.relationships[i].item <<<
}
Thanks
Solved! Go to Solution.
Solved by gasevsm. Go to Solution.
depending on what you want to do you can use
if (item.relationships.length === 0){ do something //this would do somehting if the relationship array is empty i.e. there is no relationship
or
if (item.relationships.length > 0){ do something else //this would do somehting if the relationship array is not empty i.e. there are relationships
Hope this helps
Ian
I understand, but that is not all I want to do. I want to go though each element in the relationship array to see if one of them belongs to a particular workspace.
I assume the only way I can to that is to compare it to a static workspaceID.
But I don't know how to get the workspaceID from an item (or DMSID).
Thanks
Sten
Hi Martin,
Is it possible yet to get the workspaceID of an item via scripting? I have tested item.decriptor.workspaceID but it comes back as null.
Thanks,
David.