Skip to main content
12-Amethyst
Jun 5, 2025 5:49 PM UTC
Solved

Retrieve parts related to a Document ID in WRS

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"
 }
 ]
}

 

Fadel
FadelAnswer
23-Emerald II
Jun 10, 2025 12:56 PM UTC

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

3 replies

Fadel
Fadel23-Emerald IIAnswer
23-Emerald II
Jun 10, 2025 12:56 PM UTC

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 
Translate
Buiꓘa
12-Amethyst
Jun 20, 2025 4:04 AM UTC

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

Translate
Emeritus
Jun 11, 2025 4:05 AM UTC

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.

Translate