Kathleen,
I’ll tackle one part of your question first:
- to create an association between your tables, you would draw that association in the domain model (seems like you’ve done that while learning). If I understand your tables correctly, each pltPlant object can be associated with one pltArea, meaning each pltArea can have multiple pltPlants. If that’s correct, drag an arrow from pltPlant to pltArea and the association should be created correctly.
- to populate the association, you’ll need a microflow that will be run after you import the data from the external system. This microflow will
- retrieve all pltPlant objects (using an XPath retrieve
- loop through these objects with the microflow Loop tool
- for each pltPlant, retrieve the first pltArea where PKpltPlant = pltPlant.PKpltPlant (you’ll need to use an XPath retrieve for this)
- set the association of pltPlant to the retrieved object
- once you’ve accomplished that, you can use one of the native tools in Mendix to get a drop down like you described.
- create a page in Mendix
- on this page, place a Datagrid
- point the source of the Datagrid to pltPlant
- when prompted, let Mendix automatically populate the grid
- in the Search section of the datagrid, add a new drop down search field and point it to the associated pltArea entity (I guess maybe the Area attribute)
Now when you start your app, you can import data, run the microflow you created and navigate to the page you created to see a drop down in the search bar of the Datagrid.
Hope that helps you get started,
Mike
P.S. it will probably make things easier to set both entities to be persistable.