list within list

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
tkilshaw
Posts: 170
Joined: Thu Jan 19, 2006 11:33 pm
Location: Western Canada
Contact:

list within list

Post by tkilshaw »

Class Account has a one to many reference attribute, Prospects. A prospect has a first and last name, a phone number etc.

I have a query that gets a list of Accounts. In the list I want to show:

Account #
And for each Prospect
first name
last name
phone number

I can't find a way to do this.

Perhaps there isn't one.

Any suggestions?

thanks,

Terry
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Terry,

you need to define a report with an embedded sub-report:

1) Define a report that will show all accounts (master report called AccountsReport).
a) Define a query that will find the accounts you want as data source for this report
b) Include whatever information you want to show for each account on the master report - for example, account number.

2) Define a report that will show whatever information you want for each Prospect - for example, first name, last name etc (called ProspectsReport)
Specify that the data source for this report is determined at run-time

3) Include a sub-report element into your master report. When defining this element define a query like this:
FIND Prospect WHERE Prospect IN Account.Prospects

This is a lot simpler that it may sound. Please have a look at the Library application that has an example of a report with embedded sub-reports.

Best Regards,
Aware IM Support Team
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

There are two more ways to achieve what you want in Aware IM.

The first is to use a presentation, rather than a report, to display the results of your query. Presentations are very similar to reports except that instead of a PDF file the information is displayed as HTML and you can add hyperlinks to displayed elements so that the user can go directly to data forms by clicking the hyperlinks. Presentations and reports have compatible design so you can follow the steps described above to create a report, then export the design of the report to disk, create a presentation, import the design into the presentation and make necessary changes to enable hyperlinks. You can then specify that the Account query should display the results using the presentation.

The other way is even easier and does not require creating reports or presentations. Instead of query on Account you define a query on Prospect. This implies that object Prospect has a non-multiple attribute Account (matching to attribute Account.Prospects) that points to the account the prospect belongs (or is related) to. Object Prospect should also have a shortcut attribute AccountNumber with attribute path set to Account.Number. Now your query can look like this:

FIND ALL Prospect ORDER BY Prospect.AccountNumber, Prospect.LastName

You can select desired attributes of Prospect to be displayed for the query results, including the shortcut attribute AccountNumber to show the account number. Due to the specified sort order all the prospects will be displayed grouped by their account. This is how you can display both account and prospect information without having to use embedded lists.

You can further modify the query to be more useful by adding any desired parameters. For example, if you want to show prospects for a specific account identified by number that the user would specify at run-time, the query can look like this:

FIND Prospect WHERE Prospect.Account.Number CONTAINS ?'Account number' ORDER BY Prospect.AccountNumber, Prospect.LastName

When running this query the system will automatically display the parameters window where the user can type the account number or its part. Note that if the user does not type anything, the system will ignore the condition and display prospects for all accounts. Even then, on the query result page the user can further filter the search results to narrow down or extend the list.

Let me know if any of these solutions are acceptable to you or if you have further questions.
Aware IM Support Team
tkilshaw
Posts: 170
Joined: Thu Jan 19, 2006 11:33 pm
Location: Western Canada
Contact:

Post by tkilshaw »

I'm trying to do this using a presentation, as suggested. I ignored all of the export report and import stuff.

I created a Master presentation in Account. I created a sub-presentation in Account. In the master I used the query:

FIND Person WHERE Person In Account.Prospects

But the Sub-presentation in the Embedded presentation dialog is active but totally empty. So I can't choose the sub-presentation to display in the master.

Is this another bug like the visible flag or am I doing something wrong?

Terry
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Terry,

the sub-presentation must be defined in the Person object, not Account. Because the query that you have defined (correctly) finds Person objects Aware IM looks for presentations defined in Person and does not find any.

Best Regards
Aware IM Support Team
Post Reply