Skip to main content
12-Amethyst
June 5, 2025
Solved

Retrieve parts related to a Document ID in WRS

  • June 5, 2025
  • 2 replies
  • 539 views

Version: Windchill 12.1

 

Use Case: We associate Documents to our Parts using ReferencedBy links.


Description:

If a document changes, it will show up in the ESI output under Changed Documents. The Document IDs are present here, but the DocumentLinks are not. This is because ReferencedBy links don't change even if the Document or Parts do.

 

How do I retrieve the Parts associated with a document using WRS?

 

Example output:

{
 "AddedECN": [
 {
 "Description": "",
 "Number": "00011",
 "ObjectID": "OR:wt.change2.WTChangeOrder2:1709165",
 "@elementName": "ECNHeader",
 "Class": "com.ptc.windchill.esi.ChangeHeader",
 "LastChangedBy": "",
 "TargetID": "1000-1",
 "Name": "MyECN"
 }
 ],
 "Release": [
 {
 "Locale": "en_US",
 "Destination": "1000-1",
 "TransactionNumber": "11",
 "PrimaryObjectID": "OR:wt.change2.WTChangeOrder2",
 "@elementName": "Transaction",
 "CreatedDate": "2025-06-04 16:51:18 UTC",
 "ReleaseNumber": "10"
 }
 ],
 "ChangedDocuments": [
 {
 "Description": "",
 "ObjectID": "OR:wt.doc.WTDocument:1709259",
 "PreviousVersion": "A",
 "DocumentType": "WCTYPE|wt.doc.WTDocument|com.ptcmscloud.MY_TYPE$$Document",
 "Title": "",
 "Iteration": "2",
 "TargetID": "1000-1",
 "Name": "MyFile1",
 "Number": "0040",
 "Version": "B",
 "@elementName": "Document",
 "State": "RELEASED",
 "IsAssembly": "false",
 "Class": "com.ptc.windchill.esi.Document"
 }
 ]
}

 

Best answer by Fadel

Not sure if something enahnced in 12.1 , on 12.0 I couldn't find anything OOTB 

easiest way is to define an alias attribute on doc type to find reference parts using below mapping 

masterReference^wt.doc.WTDocumentMaster~references@wt.part.WTPartReferenceLink~referencedBy^wt.part.WTPart~number
Fadel_0-1749559977598.pngFadel_1-1749560027720.png

 

 

 

 
we can then query alias attribute in WRS 

2 replies

Fadel
Fadel23-Emerald IAnswer
23-Emerald I
June 10, 2025

Not sure if something enahnced in 12.1 , on 12.0 I couldn't find anything OOTB 

easiest way is to define an alias attribute on doc type to find reference parts using below mapping 

masterReference^wt.doc.WTDocumentMaster~references@wt.part.WTPartReferenceLink~referencedBy^wt.part.WTPart~number
Fadel_0-1749559977598.pngFadel_1-1749560027720.png

 

 

 

 
we can then query alias attribute in WRS 
Buiꓘa
12-Amethyst
June 20, 2025

That's a great suggestion and workaround. Thanks for sharing!

Community Moderator
June 11, 2025

Hello @CB_12625553,

 

It looks like you have a response from a PTC Support expert. If it helped you solve your question, please mark the reply as the Accepted Solution. 
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.