Return AutoNumber after commiting to entity

I'm new to the world of Menix, if I'm mixing things up, my apologies! I have two entities with an association. Now I would like to fill the first entity with data and an attribute is filled by autonumbering. This generated number must also be stored in the second entity. Example; I make a shopping list with items I want to buy. In my first entity I put the basic data (when do I go shopping, at which store, etc). I have an attribute with the generated number which counts as ShoppingListId. In the second entity I put the articles that I want to get. And in doing so I want to make a link to the BooschappenListId. How do I get back the automatically generated number when capturing the first entity, which I can then use when adding articles in the second entity? The data is not inserted by means of a form but comes from a web service. This web service is called at certain times during the day by a sceduled event/microflow.
1 answers


in general I read from this, that you want to use the Autonumber as Key-attribute to match your product list and the shopping cart?

In general, you don’t need key attributes to do this. You can simply create an association 


ShoppingCart 1<-----* Product List 


and save these relationship everytime you add a product to your shopping cart. Mendix itself will take care in the background, that the key-attributes are being generated. You don’t need to take care about this. :-)