Auto number
is it possible to create an auto number using the current data object’s id? In the implemented method there is only Session and Node as parameters?
If I understand your question correctly, you are looking for an Autonumber for creating an object of a specific subclass. If so, you can do that by getting the IAdmin instance from session and load the subclass and get the next available autonumber of that subclass. Use the next available number for creating the object along with the other parameters.
The below is the code snippet from Admin guide.
IAdmin admin; IAgileClass subCls1; IItem part; IAutoNumber[] numSources; String nextAvailableAutoNumber; admin = session.getAdminInstance(); subCls1 = admin.getAgileClass("SubClass1"); numSources = subCls1.getAutoNumberSources(); nextAvailableAutoNumber = numSources[0].getNextNumber(subCls1); // Create the part using the available AutoNumber part = (IItem)session.createObject(ItemConstants.CLASS_PART, nextAvailableAutoNumber); D
I think you are asking if it is possible to use the schema database ID for the object in an auto-number for that object. That I am aware of, no, this is not possible. Certainly unique, but nowhere near consecutive.
Right. The object’s internal ID is not known until after it is created. You could look at renumbering the object after its creation