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

Alternates from parts through API

akr
1-Newbie
1-Newbie

Alternates from parts through API

How to get alternates and substitutes from parts through API?

4 REPLIES 4

What do uou mean? Actually I don't understand about alternates and substitutes of part. Part is WTPart?

From th part 'PART-001046', I need its alternte part 'IR-0000000018'.

Capture.GIF

Just check whether the below query helps for Alternate parts.

QueryResult qr = wt.part.WTPartHelper.service.getAlternatesWTPartMasters(WTPartMaster);

Similarly you can use below API for Substitute Parts. The below API will give u Usage Link from which you can get the WTPartMaster.

getSubstitutesWTPartMasters(WTPartUsageLink usageLink)

HTH

Regards,

Ratnadeep

Below code is to get the alternate part info (name,number ..etc )

================================================

 

WTCollection alternateLinks = WTPartHelper.service.getAlternateLinks(WTPartMaster);

if(alternateLinks != null) {
for(Iterator it2 = alternateLinks.persistableIterator(); it2.hasNext(); ) {


WTPartAlternateLink alternateLink = (WTPartAlternateLink) it2.next();
WTPartMaster pm = alternateLink.getAlternates();

System.out.println("Part Number --------------->" + pm.getNumber());
System.out.println("Part Name --------------->" + pm.getName());
}
}

 

Regards,

Venkat

Top Tags