Are attribute-level associations possible across entities in the domain model?

0
I am new to Mendix and currently exploring possibilities with it. I wanted to check if I can create an association between logically related attributes across entities. I haven’t come across a way to do this in my short time with it so far, or maybe there is another way to achieve it. Below is what I am trying to solve - I have two tables in an external relational database namely “Orders” and “Customers” with a many-to-one relationship like Orders.CustID -------------> Customers.CustID I have already created two entities “Orders” and “Customers” with corresponding attributes in the domain model of my Mendix app. I want to show the customer record from “Customers” that is associated to an order in the “Orders”. I will be using the master-detail grid in Mendix for the purpose. I will be importing data for each entity via a microflow using REST APIs, but I want to leverage the existing relationship based on CustID amongst the objects. So, is it possible to create a many-to-one association from the attribute CustID in “Orders” entity to the attribute CustID in “Customers” entity in the domain model of my Mendix app?
asked
1 answers
2

Hi Sunil,

I recommend importing your response from your API with an import mapping. Then in a microflow retrieve the objects created from your import mapping and create objects/associate to existing objects in your data structure.

If you have CustomerID stored in your customer entity and the rest API response has customerID in the orders table, then you can retrieve the customer from the database using an xpath constraint, then create the new order and associate it to the existing customer.  

 

Here is some documentation that may be helpful

Rest call:

https://docs.mendix.com/refguide/call-rest-action

 

Import mapping:

https://docs.mendix.com/refguide/import-mappings

answered