Hyperlink not visible when cloning from a workspace
Here is my issue. We have a Workspace A, which we are creating PROJECTS and a Workspace B where we have our ITEMS.
From the Project workspace we are running a script to create an ITEM which is locate in the Item workspace
When doing this, we can see the associated Item that was created in the Project workspace as an hyperlink.
My problem is when we are adding new ITEM to this same PROJECT by using the Cloned function from the ITEM workspace, we cant see the hyperlink in the Project workspace, However we can see the Project hyperlink from the Item workspace.
Is their a way to get the hyperlink into the PROJECT workspace when using the clone? below is our scritp for the clone item.
/*
functionality: Creates a new item with the passed properties
input : baseItemName(string) - WorkSpace ID for the new item
: newItemProperties(associative array) -- Key(string) = New Item Field ID, Value = Field's value
return :
example :
var newProperties = new Array();
newProperties['TITLE'] = "This is an eample;
newProperties['QTY'] = 5;
createNewItem('WS_NAME', newProperties);
*/
function createNewItem(baseItemName, newItemProperties){
newItem = createItem(baseItemName);
for(var propKey in newItemProperties){
newItem[propKey] = newItemProperties[propKey];
}
return newItem;
}
I tried adding the below which was not successful :
//Add Item to NPD Related Items
if (item.ASSOCIATED_NPD !== null){
var npdRecord = item.ASSOCIATED_NPD;
npdRecord.relationships.addRelated(item, 'Cross-Reference', 'Unidirectional', 'Item');
}