cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Associate Document to Part (Workflow Expression)

dwilliams
12-Amethyst

Associate Document to Part (Workflow Expression)

Hello Gurus,

Through a workflow expression, I am trying to associate WTDocument to a WTProduct. Below is the code I am using but it doesn't seem to be correct. The association is not being made. The "equipmentEndItem" is a wt.part.WTProduct variable.

wt.doc.WTDocument doc = (wt.doc.WTDocument)primaryBusinessObject;
wt.part.WTPartDescribeLink describeLink = wt.part.WTPartDescribeLink.newWTPartDescribeLink(equipmentEndItem,doc);

What am I missing?

Thanks for your expertise,
Dax Williams
Business Administrator, Windchill
Lifetime Products, Inc.
-<">mailto:->

[cid:image001.jpg@01CA8234.BD30C240]
4 REPLIES 4

saving the link?

wt.fc.PersistenceHelper.manager.save(wt.part.WTPartDescribeLink.newWTPartDescribeLink(equipmentEndItem,doc));

might do the trick 😉

cheers & happy xmas,
martin

Martin,
Thank you. I figured it had something to do with saving the link, I just was sure how to do it. I appreciate your expertise.

Any ideas why I would be receiving the following runtime error? The WTDocument and the WTProduct are both checked into the libraries and neither are in a workspace.

Hi,

in this case use a server side method to bypass the listeners:

wt.fc.PersistenceServerHelper.manager.insert(wt.part.WTPartDescribeLink.newWTPartDescribeLink(equipmentEndItem,doc));

martin

Martin,
Thanks again. This method works flawlessly.
Announcements


Top Tags