Skip to main content
1-Visitor
July 21, 2014
Question

Alternates from parts through API

  • July 21, 2014
  • 2 replies
  • 2656 views

How to get alternates and substitutes from parts through API?

2 replies

1-Visitor
July 21, 2014

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

akr1-VisitorAuthor
1-Visitor
July 22, 2014

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

Capture.GIF

1-Visitor
July 22, 2014

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

11-Garnet
April 2, 2019

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