If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#373 by tkilshaw
Fri Feb 17, 2006 12:41 am
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

#374 by aware_support
Fri Feb 17, 2006 1:23 am
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,

#375 by aware_support2
Fri Feb 17, 2006 3:39 am
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.

#389 by tkilshaw
Fri Feb 17, 2006 10:04 pm
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

#395 by aware_support
Sat Feb 18, 2006 6:17 am
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

Who is online

Users browsing this forum: No registered users and 20 guests