Query Results showing multiple objects
-
- Posts: 278
- Joined: Tue Aug 05, 2008 3:16 pm
Query Results showing multiple objects
How do you get a query to return related objects in the result grid. For example, I have a Orders & OrdersDetail tables. I want to include a column/link in the result set that someone could click to get directly to the details of an Order.
rgates,
Following is one way:
Assumptions:
1- BO: Orders owns OrdersDetails with multiple allowed
2- Orders BO has an attribute Details with Presentation: Display as Table of items. Let's say you Show 10 items.
Simply create a query of the Orders BO. By default, it will include an Edit link in the query. If you have followed the assumptions above, when you click on Edit for an Order, you will see a form that has both Order info and the related OrderDetails info.
Hope this helps.
Tom
Following is one way:
Assumptions:
1- BO: Orders owns OrdersDetails with multiple allowed
2- Orders BO has an attribute Details with Presentation: Display as Table of items. Let's say you Show 10 items.
Simply create a query of the Orders BO. By default, it will include an Edit link in the query. If you have followed the assumptions above, when you click on Edit for an Order, you will see a form that has both Order info and the related OrderDetails info.
Hope this helps.
Tom
-
- Posts: 278
- Joined: Tue Aug 05, 2008 3:16 pm
Not really
Your method requires the user click on the main object to see the sub object. This means that from a query a person wouldn't know if the sub objects even existed until they "dived" further into the data.
I used a product from Intuit called Quickbase. You could present links that were to the sub objects. For example, the link might be "order details" or even a summary of the number of sub objects that once clicked would bring you to the summary of multiple sub objects.
I used a product from Intuit called Quickbase. You could present links that were to the sub objects. For example, the link might be "order details" or even a summary of the number of sub objects that once clicked would bring you to the summary of multiple sub objects.
rgates,
1- Add attribute Orders.DetailCount
2- Add rule to Orders:
FIND OrderDetails WHERE OrderDetails.OrderInfo=Orders
Orders.DetailCount=COUNT OrderDetails WHERE (OrderDetails.OrderInfo=Orders)
3- In the Orders query, add an applicabilty condition:
Orders.DetailCount>=1
The Edit link will now appear only if OrderDetails exists for an Order.
You can also rename the Edit link to another name if you'd like.
Tom
1- Add attribute Orders.DetailCount
2- Add rule to Orders:
FIND OrderDetails WHERE OrderDetails.OrderInfo=Orders
Orders.DetailCount=COUNT OrderDetails WHERE (OrderDetails.OrderInfo=Orders)
3- In the Orders query, add an applicabilty condition:
Orders.DetailCount>=1
The Edit link will now appear only if OrderDetails exists for an Order.
You can also rename the Edit link to another name if you'd like.
Tom