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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

How to get the WTDocument from WTPart through customization ?

CH_10067600
10-Marble

How to get the WTDocument from WTPart through customization ?

 

2 REPLIES 2
Fadel
22-Sapphire II
(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

 

Announcements

Top Tags