Hi you could do a sort on one of the attributes that you like in the retrieve(ascending or descending) then just pick 'first’. This way you can get the last item from a list based on your sorting.
In your domain model, when opening an Entity,
you can select to store 1 or more System members.
One of those system members is: ‘Store CreatedDate’
You can use X-path to access this member, then sort DESC, and so you can access the last created object