How to select different values in reference selector

0
Hi all, I have a form entity and employee entity with name field. That employee can be a recommender. So I want two fields as Recommender1 and recommender2. I have user reference selector in form entity dataview as Recommender1 and Recommender2. But my problem is if I select Recommender1 value then same value reflects in Recommender2 field and vice versa. I want to select different employee name as Recommender1 and Recommender2. Can you help me how to do that. Thanks in advance.
asked
2 answers
0

Hi Priyanka,

I see there are two potential solutions.

1) Create two separate associations from your main entity to the employee (*-1), one for recommender1 and one for recommender2. 

2) Use an information entity to allow you to 'store additional information about the associated objects). See https://academy.mendix.com/link/modules/93/lectures/2794/-5.3-Information-Entities for more information.

Hope this helps.

answered
0

A reference selector works in combination with a 1-* association. So One employee can be referenced by many form entity objects and one form entity object can reference ONE employee. Have 2 times a reference selector widget using the same association doesn't change the multiplicity of the used association.

 

You have 3 solutions

  1. Change the association to a *-* > allows you to select multiple employees over the same association. However, you cannot distinct which is recomender1, 2 ,3 etc. its just a list of selected employees. If there is no hiarchy, this is the way to go.
  2. Draw 2 1-* associations between the form entity and the employee. This allows you to select 2 specific employees using 2 reference selectors which use their OWN association. its possible to distinct Recomender1 and 2. Drawback, no option to select a 3rd, 4rd etc employee. < use this if its just reomommender 1 and 2 and hiarchy is important
  3. use an selection entity inbetween. just like an orderline between an order and a product. Benefit, you can add all kinds of additional info, drawback, its a bit of more modeling < BEst way to go if you app becomes advanced

 

answered