Hi Richard,
I guess you are doing a retrieve from database with the contract as parameter for the retrieve.
As the newly created contract has not been committed to the database yet, the result of the retrieve is an empty list, as the associations have not been set in the database.
I just created a test project in Mendix 7.8.0 for this use case, using default functionality (i.e. no custom create or save flows) ran it with no security, and it works as expected: if I have 3 afspraken, I retrieve them, I create and commit 3 contractafspraken en I can see them on my Contract_NewEdit page. Either something has changed between 7.8.0 and 7.23.3 and in this case you should file a ticket at support.mendix.com, or there is an error in your modelling (are you sure you have set the event handler?).
I don't know the reason, but what is it that you try to do exactly? Seems a little bit odd to retrieve all the ‘Afspraak' objects and create new ‘Contractafspraak’ objects after a create of a ‘Contract’ with the use of an after create microflow?
Why not add this functionality to a custom save button after creating the contract?
It is quite logical. This microflow is triggered immediately after the creation of the object. I assume you have a create and change in the same action? Because indeed the after create will run before the changes on the object and thus indeed are still empty because the changes have not been done yet on the object.
Regards,
Ronald