How to set the default to the reference selector?

0
I have two entities A and B and a one to many relation from A to B (one object of B is associated with multiple objects of A). With this reference I've created a reference selector and reference selector attribute is an integer attribute(option). I'm retrieving the objects from the database by sorting the option in descending order. In the reference selector I'm getting empty option as the default value. How can I assign default value to the reference selector.   In my case I want to set the maximum option value as the default value.  
asked
1 answers
0

You can't set this default in the entity properties.  You could do this by creating an After Create microflow for entity A.  In this microflow, put a retrieve by XPath, sort descending by the Option attribute and only return the first object.  Then set the association A_B to the returned value.  The retrieve will look something like this:

image.png

Hope that helps.

answered