One-to-many Registration

I have a simple model that looks like the image.  I created a registration page that uses a microflow to add to the StaffRegistration entity.  However, I am not familiar with how Mendix creates the database record so that the Staff entity has a new person in it with the supplier they work for (based on the ANID collected in the registration.)  How do I get the microflow to add the details to the Staff account along with the ANID they enter in the registration form?  
1 answers

In your microflow,

  • add a retrieve action using XPath. 
  • Build the XPath to retrieve the Supplier with ANID matching the one supplied during registration. 
  • You’ll need to click First in the retrieve. 
  • If the retrieve returns an object, it will be in the microflow variable with the name you supplied in the retrieve. 
  • When you create the Staff object, you’ll have the ability to set attributes (name, email, etc.) and associations (Staff_Supplier).  In the item for Staff_Supplier, use the object you retrieved.

Hope that helps.