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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How can set serial effectivity with context and serial number for any child through API

AA_9841156
10-Marble

How can set serial effectivity with context and serial number for any child through API

Hi @HelesicPetr,

How can set serial effectivity with context and serial number for any child through API

Reference topic - https://community.ptc.com/t5/Windchill/API-for-setting-effectivity/m-p/294903#M34550

2 REPLIES 2

Hi @AA_9841156 

Try the serialEffectivity class

 

WTSerialNumberedEffectivity eff = WTSerialNumberedEffectivity.newWTSerialNumberedEffectivity();
//... code to define all to effectivity

// assign the effectivity to object (WTPart/EPMDocument/WTDOcument/others objects)
EffectivityHelper.setEffectivityTarget(eff,wtpart);

 

PetrH 

Hi @Per 

 

Thanks for sharing solution btw i used below code and its working .have you any idea how to get all service effectivity from parts as stored in Manage applicability.

ServiceEffectivity se = ServiceEffectivity.newServiceEffectivity(part);
se.setEffContext((EffContext) parentpart.getMaster());
//se.setBeginSerialNumberRange(String.valueOf(startRange));
//se.setEndSerialNumberRange(String.valueOf(endRange));
se.setEffectivityType("serialNumber");
//WTPart p=(WTPart)se.getEffContext();


PersistenceHelper.manager.store(se);

Announcements

Top Tags