Microflows for Associations

0
  I’m basically looking for a tutorial on how to create a microflow for the following:   Step 1: I’m on the Employees Profile Page – Every employee profile has a Unique Employee ID –   Step 2: On this page, I have a data grid that is association ErgoReport to Employee Profile to be able to display the Employee’s Office Ergonomic Settings once they are entered.         and when I click “New” it will bring up the data entry form for this data grid.     Step 3: I have added an enumeration at the top of this form for the user to select the employee ID because that is the only way that I can get the data to display on the employee’s associated profile once saved and then return to employee profile page. .       My question is: Is there a way to create a Microflow that when I click “New” to enter the data for this employee that it automatically pulls the Employee ID over to the form and create that association without having to manually select the ID from a field? I am using Mendix Studio version 8.18. 
asked
5 answers
4

Mendix handels the foreign keys of the objects. You cannot define them yourself.

My assumption is that you have two entities Employee and WorkingEnvironment with an association in between.

 

Add a Create button (not the new button part of the datagrid itself) and configure it as follows (the new button configuration in studio is limited, in studio pro this is possible)

  1. Show a page
  2. Create object
  3. use path WorkingEnvironment_Employee/WorkingEnvironment
  4. Connect edit page WorkingEnvironment

 

 

answered
1

Hi Jaclyn

              If you dont have unique identifier, even if you create microflow, it doesnot know to whom it needs to associate. If you are using the dataview and try to click new which has microflow, the employee parameter needs to be passed. Then create new object and its associations. Thanks

answered
0

Ok, since I only work in Studio pro it might be a bit harder form me to explain. If the reference already exist between workenvironment and employee you do not need a microflow at all. Just drop the grid inside the dataview of the employee. If I am not mistaken it will only retrieve the workenvironments over the association between the two. When creating a new workenvironment it then will also automaticly set the reference to the employee. 

Regards,

Ronald

 

answered
0

Ronald, 

 

If I don’t have a unique identifier in the data entry form after clicking “New work environment” than the system will not know the association between the data entered and the employee. which is why I need the Employee ID as a selection in the data entry form as the only unique identifier). So unless I add that to the data entry form, there’s no way for the data to display in the grid for that employee – correct? when I create “new” work environment from the employees profile page it is not automatically creating that association/reference and I’m unsure why. but as soon as I added the Unique ID drop down to select in the work environment data entry form it then displayed the data for the employee. I feel like there should be a way for this to automatically happen as you have indicated above. But perhaps it’s only available in Studio Pro? 

 

Jaclyn 

answered
0

This worked Rene! Thank you so much everyone for your responses! Truly appreciate the help! :)

 

Jaclyn

answered