Reference selector: Many-to-one associations: Constrain selection for already chosen relations

Hi everybody :)   I have an entity ‘Person’ that has two associations to an entity ‘Contact’, both of type Many-Contacts to One-Person. These two relations allow Person_1 to create an object: ‘Contact_1” - with attribute boolean=false - with one association to Person_1 and one association to Person_2   Only Person_2 is then allowed to set the boolean=true. However, I do not want either Person_1 or Person_2 to be able to create another Contact_x with the other Person. Currently I am using a reference selector, so Person_1 can find e.g. Person_2 in a list. However, I cannot constrain that list to NOT include Person_2 after the Contact has been created. The entity ‘Person’ has a one-to-one relation to the entity ‘Administration.Account’. I have tried a lot, both with xPaths and Microflows.    Any help is highly appreciated! xD
1 answers

To constrain the objects for having an association already. In your reference selector, under the selectable objects make use of x-path constrain not() function. 

How ever you can achieve the functionality in microflow through below mentioned logic:

1, Create a microflow and retrieve the list from person entity,

2, Create a new list for person entity,

3,  Put a Retrieve activity by association inside the loop for contact entity.

4, Followed by check the retrieve activity is empty. if empty add the IteratorObject to the list, else continue.

5, Finally the return the  new Person list.

Hope this helps

Best Regards,