Assistance with a Project Contact Directory Showing Roles

Hi everyone, I have a basic app that shows a list of projects (we are a construction management firm).  I have one entity for "Project" and another for "Person" Here is what I am trying to do.... Associate a person with a project AND show their role on the project This could vary project to project.  So for example we might work with an architect and they are the architect on every single project.  But, we might have one of our employees be a designer on one project and a project manager on another project.  So I need to dynamically map the role to the person per project.   And of course display a contact listing that shows each person, their contact info, and their role on the project.   For starters thought on what the data model looks like?  How do I join this data?  And how do I represent that in Mendix to make the form dynamically build?  Report I should say...
2 answers

Hi Ivan,

You can accomplish what you want with a third table between "Project" and "Person". Something like this

With this model, a Person can have many roles, with every role associated to one project. Allowing you to add unique attributes to the role table that only applies per project. In this case I added an enumeration the roles table that has a value of architect, designer, and project manager. You can add more attributes to this table that would be unique to the project and only applies to a single person.


Now with this model, you can start with a page that has a datagrid of "project", and use the generate page feature on the new/edit buttons (right click > generate page). Then the modeler creates a page with a dataview of project. You can then add a datagrid with datasource over association and display  "roles". This will allow you to associate and display associated people/their roles to this project. 

Something like this. The datagrid over association will display all roles associated to that project. You can also add a column that displays the name attribute from the persons table (which is how you can display their contact details). Then you can add an action button to the datagrid with something along the lines of this


and that displays a page like this


So I think I now understand it more....  After adding my comments above.


I added the following microflow:


The issue now is when I run it instead of seeing that popup screen I get a dialog that says:


"Information" as the header

No selection available in the page.


Something is still not right :(