This example demonstrates how you can use internal object ids to identify objects across objects containers. Take a look advantages and disadvantages of internal ids: See "Comparison Of Different IDs"
For using the internal ids no additional configuration is required. You can get this id for any object.
You can get the internal id from the extended object container.
long interalId = container.Ext().GetID(obj);
Dim interalId As Long = container.Ext().GetID(obj)
Getting a object by its id is also easy. First you get the object from the container. Unlike queries this won't return a activated object. So you have to do it explicitly.
long internalId = idForObject; object objectForID = container.Ext().GetByID(internalId); // getting by id doesn't activate the object // so you need to do it manually container.Ext().Activate(objectForID);
Dim internalId As Long = idForObject Dim objForID As Object = container.Ext().GetByID(internalId) ' getting by id doesn't activate the object ' so you need to do it manually container.Ext().Activate(objForID)