Suggestion: Give the parent an attribute ‘child-counter’ and the child entity an aftercreate-microflow which increases the ‘child-counter’ by one and storing that value also in an attribute in the child, commiting it ‘without events’ to prevent triggering the ACr again (and again).
Are you by any chance retrieving your parent object via XPath?
Retrieving via association should work even on uncommitted objects but xpaths won’t until you commit that object.
Hope this helps
create an attribute of type autonumber, this will make sure each child object gets an unique number higher then the previous one. NOTE : if you create an object, but never commit the object the number is lost. Gaps between the numbers will exist.
Create an attribute of type integer/long, default value is empty for the counter on the child object. Create a custom save button which checks the counter, if empty it must determine the correct number by retrieving the parent by association and retrieve all childs by association and filter the ones with a counter > 0. Sort the list descending based upon the counter, use the head option to retrieve the last one and increment that number with 1.