Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
I have parts updated with wrong Effectivities applied, and i want to remove those applied effectivities bulk using Info*Engine task, is there any tasks to remove effectivities?
No, there is no webject to do this kind of thing.
But you can easily use java code within the task.
Hi Srinivas Morla,
I had requirement on similar line where my customer wanted to delete/remove only Serial Numbered Effectivity.
Though there isn’t any real support in this case between creating, updating or removing effectivities we were able to remove effectivity (here Serial Numbered Effectivity) using wt.fc.PersistenceHelper.manager.delete((wt.part.ProductSerialNumberEffectivity)serial); API call.
I hope this helps you...
Regards,
Shirish
Hi Shirish,
I want to delete the effectivity based on the context and the serial number. I have seen your API and it deletes all serial numbers associated with all effectivity contexts, rather than those associated with a particular effectivity context. - which is what I am going for.
Any APIs to can help me with that?
Thanks in advance.
Srinivas,
Bulk deletion of WTPart Effectivity is no problem. But why are you putting the requirement of using an I*E tasks? Why not write a simple Java method to do this?
Can you explain how you are determining which WTParts you intend to delete the effectivity from? We need to know this so that we can pass the WTParts to the code.
David
Hi David,
I want to delete the effectivity from WTParts that have a specific serial number associated with a particular effectivity context. I have multiple effectivity contexts with the same serial number associated for the same WTPart. Using Shirishkumar Morkhade's API, I can manage to delete all effectivity having the same serial number, irrespective of the context. I want to include the context as part of the deletion criteria, as well.
I agree - I*E webjects may not be the way to go. I am open to Java APIs as well.
Thanks,
Srinivas
Srinivas,
Thanks for the additional info. Now I clearly understand what you want to do.
All of the Effectivitiy dB tables including productsneffectivity (class wt.part.ProductSerialNumberEffectivity) reference both the WTPartMaster and the WTPart branch (version). So, it you want to delete all effectivities that use a particular number. You write a QuerySpec to find ProductSerialNumberEffectivity that reference the oid of the WTPartMaster. You then pass the QuerySpec to PersistenceHelper to return a QueryResult. You can then loop thru the QueryResult and delete each ProductSerialNumberEffectivity object.
Keep in mind all Effectivites also reference a wt.eff.EffChangeAudit object. My testing showed that PersistenceHelper.manager.delete() does not collect these EffChangeAudit objects (which is likely why there is no "Supported" way to delete). So, rather than leaving them orphaned in the dB I suggest getting them from the ProductSerialNumberEffectivity object, adding both the ProductSerialNumberEffectivity and EffChangeAudit objects to a WTSet and then deleting the set using PersistenceHelper.manager.delete(). This will ensure that either both or neither get deleted which is what you want.
That will get the job done. If you need more help please contact me via email.