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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

API to get WTPartRequest associated with WTPart

Sitanshu
5-Regular Member

API to get WTPartRequest associated with WTPart

Hi All,

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

Thanks

Sitanshu

3 REPLIES 3

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

Sitanshu
5-Regular Member
(To:ShirishMorkhade)

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

 

mcastelletti
6-Contributor
(To:Sitanshu)

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

Top Tags