Skip to main content
1-Visitor
April 23, 2019
Question

API to get WTPartRequest associated with WTPart

  • April 23, 2019
  • 1 reply
  • 2106 views

Hi All,

Need to fetch all the WTPartRequest attached to a WTPart. If you have ready code available then please suggest.

Thanks

Sitanshu

1 reply

16-Pearl
April 23, 2019

Hi @Sitanshu ,

Try using below snippet. I used this way before and sure if this is same API for latest WC release.

But it is worth to try this for latest release too:

 

WTCollection requests = new WTHashSet();
WTPartMaster master = (WTPartMaster)part.getMaster();
long partMasterId = master.getPersistInfo().getObjectIdentifier().getId();
QuerySpec qs = new QuerySpec();
int ind = qs.appendClassList(WTPartRequest.class, true);
qs.appendWhere(new SearchCondition(WTPartRequest.class, WTPartRequest.RESULTING_PART_MASTER_REFERENCE + '.' + WTAttributeNameIfc.REF_OBJECT_ID, new long [] {partMasterId}), new int[]{ind});
QueryResult qr = PersistenceHelper.manager.find(qs);

I hope this helps you.

 

Regards,

Shirish

Sitanshu1-VisitorAuthor
1-Visitor
April 24, 2019

Thanks. But, I need related parts information. Untitled.png

 

5-Regular Member
November 6, 2020

Hi , were you founding a solution to retrieve the part request that was used to request that Wtpart?

So from the wtpart I would like to have a link to the wtpart request.

 

THX