I want to have access to those instances from a script when creating a new resource. Is there a call to do it?
Those are related to instances in the element table.
Thanks
I think I have to go through the entry point that gives the reference to the table where the instances are. Then it's matter of knowing which instances are already in use and substract them from the full list.
Indeed, from the function entry point you need to get all primary keys of that table.