To create the OrdersView view object:
1- In the System Navigator, right click your package node (onlineOrders) and choose New View Object from the popup menu.
2- On the Welcome page, review the information there and click Next.
3- On the Name page, enter OrdersView in the Name field and click Next.
4- On the Entity Objects page, select the Orders entity object in the Available pane and shuttle it to the Selected pane.
5- Click Customers in the Available pane and shuttle it to the Selected pane.
Notice that the checkboxes for Read Only and Reference are both selected. After the first entity object has been added, the framework makes all subsequent entity object's read-only and dynamically referenceable by default. Since this is the behavior we desire in this application, we don't need to change anything. (For more information on these features, click Help.)
6- Click Next.
7- On the Attributes page, in the Available pane, shuttle all the attributes under Orders to the Selected Pane. You can shift-click to select more than one item.
8- In the Available pane, under the Customers node, shuttle CustFirstName and CustLastName to the Selected pane.
Notice that the primary key attribute, CustomerId, is brought into the selected pane as well. This is required for the join condition between Orders and Customers.
9- Click Finish.
Your OrdersView view object now appears under your package node in the System Navigator.
Your business logic tier now contains two view objects that can be accessed from a user interface. The OrdersView view object contains information about the order, such as the OrderId, the OrderDate, and the OrderTotal, as well as the customer's name. The OrderItemsView view object contains information about the individual line items in an order. If you were to create a client to access the business logic tier right now, you would be able to see information about an order, or information about a single line item in an order. But what you really want to see is information about an order and the details of all the line items that order contains. To implement this you need to define a master-detail relationship using a view link.
In the next step, you will create a master-detail view link.