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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

How to get the WTDocument from WTPart through customization ?

CH_10067600
6-Contributor

How to get the WTDocument from WTPart through customization ?

 

2 REPLIES 2
Fadel
22-Sapphire I
(To:CH_10067600)

Hi , 

  • Described By Documents
 
QueryResult qr = PersistenceHelper.manager.navigate(part,WTPartDescribeLink.DESCRIBED_BY_ROLE, wt.part.WTPartDescribeLink.class,false);
 
while (qr.hasMoreElements()){
WTPartDescribeLink link = (WTPartDescribeLink)qr.nextElement();
System.out.println("Found link ..........." + link);
WTDocument doc = link.getDescribedBy();
System.out.println("Described By Document ...."+ doc.getNumber());
}
 
  • References Documents
QueryResult qr = PersistenceHelper.manager.navigate(part,WTPartReferenceLink.REFERENCES_ROLE, wt.part.WTPartReferenceLink.class,false);
 
while (qr.hasMoreElements()){
WTPartReferenceLink link = (WTPartReferenceLink)qr.nextElement();
System.out.println("Found link ..........." + link);
WTDocumentMaster doc = link.getReferences();
System.out.println("Referenced By Document ...."+ doc.getNumber());
}
 
 
BR,
Fadel
Fede

Some additional reference is available here: https://www.ptc.com/en/support/article/CS385644

 

Top Tags