So i currently have my app set up to where a user of type "Supplier" can upload products and then view the uploaded products, but there's a few issues that i haven't been able to figure out. First, i want the Suppliers to only see products they themselves have uploaded, not all the products in the database, i figured this should be doable with setting up an XPath-constraint to only show products made by currentuser, but i haven't been able to get that to work yet. Secondly, i want it to, when a supplier tries to upload a product that's already in the database(for instance, a supplier uploads a product named 'Coke bottle' and then another supplier uploads a product also named 'Coke bottle') add that supplier to the product, so that i can later show all the suppliers of a product. I struggled with this because i can't give my entity 'Products' an attribute of type list, so that i could just add suppliers to that list, so how would i go about doing this? I'm also having issues with creating a custom entity for users ( i would like 2 user entities, 1 for said 'Supplier' and one for just regular users). I read that these entities should be generalizations of Administration.Account, but i also read that it should be of System.User. I'm also unsure of how to then create objects of said user entities upon creation of a new account, do i just edit the Admin.SaveNewAccount microflow to create an object depending on the type of Account? Any help would be greatly appreciated :)
Concerning your question one: you indeed need to retrieve the data by Xpath and then put a path to the user.
Of course you should make sure that your domain model has the right associations.
Second question: You can just add an attribute of products (no need for a list attribute like you mentioned). Then when the supplier saves the specific product you can save the specific (logged in) supplier of this product in a microflow. In this way you can later retrieve the combination of product and supplier in a list.
Question 3: inherit form administration.account. This in turn is connected to system.user (but you can just leave this as is).
Josephine van Eeden
First issue: at an entity, you can set the system member 'Save Owner'. In the entity access you can then set the path to owner, this way restricting the viewing right to only items where the user is 'owner' of (ie: he created).
Second issue: this deals with how your domain model is setup: you can connect entities (in your case, products and suppliers) but I'd recommend reading through all available material (https://gettingstarted.mendixcloud.com/link/module/4/lecture/183) before making a decision on this.
Third issue: I would not recommend either. Create a separate entity (like Person) that has a type (which can be Supplier for instance) and connect that to the Account entity. This saves you from complications/restrictions regarding entity access on Account, resulting from the inheritance.