Retrieving an item created with SaveAs via API
Hi,
I’m creating a simple script that has to make few checks on an item cloned from another one.
It has to run triggered by a SaveAs Object event, but it goes checking the old item (the one that I saved as) and not the new item.
How can I correct these two lines of code to point to the newly created item?
IObjectEventInfo objectEventInfo = (IObjectEventInfo) eventInfo;
IItem currentItem = (IItem) objectEventInfo.getDataObject();
Hi Roberto,
As described in this topic the Save As Event PX contains information about objcID and classID
ISaveAsEventInfo saveAsevent = (ISaveAsEventInfo) event;
Integer subclassId = saveAsevent.getNewSubclassId();
String newNumber = saveAsevent.getNewNumber();
IDataObject newObject = (IDataObject) session.getObject(subclassId, newNumber);
I hope that it is helpful