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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

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

AA_9841156
7-Bedrock

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);

Top Tags