Adding OrderItems to OrderHead

0
Hi all, I am trying to get the following app done. User creates OrderHead (Dedicated Entity) incl. CustomerName, Address, DueDate, OrderHead_ID User can add several OrderItems to this OrderHead incl. Product, Quantity, Price I would like to have the following GUI: Top section: OrderHead OrderHead at top section using a dataview. Fields are populated with latest Order per XPath contraint. Lower Section: OrderItem OrderItem at lower section using a datalist User can create new OrderItems from this view (e.g. triggering OrderItemNewEdit microflow), OrderItem should be linked to OrderHead_ID I get stuck at the following: How to create a new OrderItem, link it to OrderHead_ID and show the results back in the list. Any suggestion? Would be highly appreciated :-)
asked
1 answers
0

Tim,

  • Inside of your OrderHead dataview, create a datagrid. The datasource for this datagrid should be Database and you should follow the association that exists between OrderHead and OrderItem (I am assuming you have this association in place), you'll be able to navigate through this association in the finder on the lower right hand side of the modeler and select the OrderItem entity after you drill down 1 level..
  • After you create this datagrid and select OrderItem in this way, let Mendix automatically fill the contents of it, the modeler will ask if you want to do this. What you'll end up with is a datagrid with Search, New, Edit and Delete buttons.
  • Now, right mouse click the New button and select Generate Page - this will make a page for you to use to create a new OrderItem and edit it. You will likely want to change this page somewhat, but at least you'll have a functioning way to add items to an order.

Have fun!

Mike

answered