Help with Managed/Linked Items

Help with Managed/Linked Items

Anonymous
Not applicable
612 Views
2 Replies
Message 1 of 3

Help with Managed/Linked Items

Anonymous
Not applicable

Hello,

 

We have two workspaces, "Supplier" and "Supplier Enquiries".

 

 

I'm trying to script from the "supplier enquiries" workspace, to add itself as a managed item in the "Supplier" workspace.

 

For testing I've set up an on-demand script, that is as such:

        item.SUPPLIER.workflowItems.addItem({RELATED:item, SUBJECT:item.SUBJECT, DATE_RAISED:item.DATE_RAISED, INFORMATION: item.QUOTE_RECEIVED_AFTER});

It's creating the linked item, however I can't get it to copy over any of the custom fields (subject, date raised and information).

 

item.SUPPLIER is a linked field to the supplier workspace.

 

 

Pulling my hair out here, what am I doing wrong? Any help would be greatly appreciated.

 

Cheers,

 

Stuart

 

 

0 Likes
Accepted solutions (1)
613 Views
2 Replies
Replies (2)
Message 2 of 3

tony.mandatori
Autodesk
Autodesk
Accepted solution

I tested this and I was able to reproduce the issue.

 

I was able to workaround this by structuring the code as follows:

 

var workflowItem = item.RELATED_ECO.workflowItems.addItem({RELATED:item});
workflowItem.ITEM_SUBJECT = item.NUMBER;

 

Can you try this and see if it works?

 

Message 3 of 3

Anonymous
Not applicable

Can't say I understand what's going on with the original code, but what you suggested has worked a treat!

 

Cheers

var thisIsAVariable = item.SUPPLIER.workflowItems.addItem({RELATED:item});
        thisIsAVariable.SUBJECT = item.SUBJECT;
0 Likes