Unidirectional Relationship

Unidirectional Relationship

b_sugumar
Enthusiast Enthusiast
546 Views
1 Reply
Message 1 of 2

Unidirectional Relationship

b_sugumar
Enthusiast
Enthusiast

Change Requests added in a field within the Task workspace. When I execute a workflow action in the Task workspace, the Task should be linked to the Change Requests in their Relationship tab only, without adding a corresponding link to the Task's Relationship tab.

I tried below which failed with Wrapped com.dms.scripting.exceptions.ScriptFunctionException: Cannot add a new relationship based on Task
var relatedCR = item.RELATED_MULTIPLE_CR[i];

var PdcmTask = item.descriptor.descriptor;

relatedCR.relationships.addRelated(PdcmTask, "Cross-Reference", "Unidirectional","Related Change Request");

 

When I tried below, CR was added to Task relationship tab not in CR relationship

var relatedCR = item.RELATED_MULTIPLE_CR[i];

item.relationships.addRelated(relatedCR, "Cross-Reference", "Unidirectional","Related Change Request");

 

 

0 Likes
Accepted solutions (1)
547 Views
1 Reply
Reply (1)
Message 2 of 2

sven.dickmans
Autodesk
Autodesk
Accepted solution

You should change your code like this:

 

var relatedCR = item.RELATED_MULTIPLE_CR[i];

var PdcmTask = item.descriptor.descriptor;

relatedCR.relationships.addRelated(item, "Cross-Reference", "Unidirectional","Related Change Request");