how to create a dropdown to select a company related to the user? (many-to-many association)

0
Basically, all my data will be associated with entity "Company" and each user may have been connected to one or more "Company". So I would like the user to select the "Company" and then display only the related data. The "Company" entity has a multiple membership for the "User" entity. I tried creating a layout and adding a dropdown at the top, so that on every page you could select the "Company". I had been thinking about changing the value of the dropdown to call a microflow with a "show page" activity by filtering the data through the "company". The image below represents what I'm trying to create. But I do not know how to create the dropdown in that location.  
asked
2 answers
1

You could add a snippet to the layout that has a dataview that retrieves the user with a data source microflow.

Once you have the user in the dataview you could add a button that has the caption that displays the current company selected for the user. On the button add a microflow to open a page with the user as the parameter for a dataview that shows a reference selector for the current company. This however implies a change in your domain model. The user should have a *-* relation to the company for all companies that the user can belong to and a 1-* relation for the current company. This last relation is used for the reference selector mentioned above and you can use the *-* relation to constrain the options for the reference selector. Then in your entity access use the 1-* relation to restrict the data permissions.

Hope this helps you in finding a solution for your requirement.

answered
0

This is the way I created it, and the error that appears that I do not know how to solve. I can not edit the System.User.

 

 

answered