Linking object from one entity to another entity

0
Hi, I'm fairly new to Mendix and I am looking for help. I have 2 entities: Product and ToBuy, they are both connected. I have a page (page MinStock) that shows a list of products that are under the minimum stock. Also, I have another page (page BuyProduct) that need to show those products that are under the minimum stocks so that I can buy it to the concerned supplier. The problem is MinStock uses entity Product while BuyProduct uses entity ToBuy, they have a common attributes: which is ProductID. And the other attributes are not the same. How can I link these two pages together? for example, if I click on a product in MinStock page, I want it to be redirected to the BuyProduct page, so that I can make a purchase order to the supplier of the same product that is displayed on MinStock page. So to be short, I want the BuyProduct page to show the same list of products as the MinStock page. It's confusing since they use two different entities. Kind regards Henka 
asked
2 answers
3

One important thing is to get your datamodel straight. You created two entities for ‘Product’. ‘ToBuy’ is not an entity by itself, but rather an attribute of ‘Product’. From your description you can derive that you only have one entity ‘Product’ which has attributes ‘ActualStock’, ‘MinimalStock’ and ‘OpenToBuy’ (which you can make a calculated field). 

If you stick with the current datamodel, which can work fine too, then make sure your two Product-entities have a 1-1 relation.

answered
1

Just create an association from ToBuy to Product, that should allow you to navigate between the pages.

answered