Usage of Reference Selector on a 1-n n-1 relation

0
I'm a Mendix newbie. In know how to use the Reference_selector in a  See the Domain Model. I want to assign the OfficerPerGuardDuty to the Occupation. So, an OfficerPerGuardDuty can have multiple Occupation-items. The GuardDuty is 1 object passed via a parameter which is passed through another page. So, the GuardDuty doesn't change in this page. The Officer is to be picked out from the ReferenceSelector. However, I want that the options to pick from, are selected from the available Officers, assigned to the OfficerPerGuardDuty, which is assigned to the GuardDuty. So, every GuardDuty has a limited set of Officers. As you can see below, now it picks from the association OfficerPerGuardDuty. But how do I select from the Officer.  How would I implement that in a Reference-selector, or, is the Reference-selector the right tool to make such a construction? 
asked
2 answers
0

Hi Roy,

The example doesn't work, because the page parameter here is occupation, but there is no direct association with the officer entity.

To use a reference selector here, you can do the following.

  1. Make sure an  ‘officerperguardduty’ object is created and associated with occupation, before opening the page.
  2. Create a dataview of entity ‘officerperguardduty’ and fill it from context over the association with occupation. 
  3. Place the reference selector in the dataview, since you want to set the association from ‘officerperguardduty’ to ‘officer’

 

Hope this helps!

answered
0

Hi Roy,

 

If it’s me, I would add two more associations such as a many to many association between Occupation and Officer and a many to one association between Officer and GuardDuty.

 

Just take my answer as a reference. Hope this gives you some insight!

answered