Query Results showing multiple objects

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
[email protected]
Posts: 278
Joined: Tue Aug 05, 2008 3:16 pm

Query Results showing multiple objects

Post by [email protected] »

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.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

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
[email protected]
Posts: 278
Joined: Tue Aug 05, 2008 3:16 pm

Not really

Post by [email protected] »

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.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

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
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

rgates,

In step #2 above, you only need:

Orders.DetailCount=COUNT OrderDetails WHERE (OrderDetails.OrderInfo=Orders)

The FIND part of the rule is not needed.

Tom
Post Reply