Skip to main content
1-Visitor
Jul 21, 2014 10:48 AM UTC
Question

Alternates from parts through API

How to get alternates and substitutes from parts through API?

4 replies

1-Visitor
Jul 21, 2014 12:16 PM UTC

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

Translate
akr1-VisitorAuthor
1-Visitor
Jul 22, 2014 7:11 AM UTC

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

Capture.GIF

Translate
1-Visitor
Jul 22, 2014 7:27 AM UTC

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

Translate
11-Garnet
Apr 2, 2019 6:55 AM UTC

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

Translate