I want to create a field that will get the contents of a summary field in a related table, based on a sort in a specific layout. (the summary field is in a subsummary part).
Thanks for any advice.
The second parameter in the GetSummary function is the break field, in other words the field that you use to group the records. You have used RelatedTO::Field ID, which won't give you what you want as each ID field is unique, so the file will sort into groups of one record. The break field should be the same field on which the subsummary part is sorted.
I suggest you read about the GetSummary function in Help, to try and get you head around it. Note especially the following two points:
1. "GetSummary must be set up in the same table as the break field."
2. "If the database file isn’t sorted by the break field, the result is blank."
You will eventually get the result you wamt, but it may take some trial and error—and some frustration!
The new field needs to use the GetSummary( ) function.
Thanks for your reply, keywords!
I found the function, but still nothing is coming through when I use this calculation:
GetSummary ( RelatedTO::TOTAL Amount ; RelatedTO::Field ID )
Any ideas for me?
One other thing—
You don't need to use GetSummary on the subsummary part. All you need in that instances is the summary field and it will automatically give you a summary based on the sort of that subsummary part (provided the file is sorted on that field). GetSummary enables you to grab the resukt in that particular instance of the summary field and use it on, say, another layout—in a report, for example.
Very helpful, thank you keywords!
keywords, you are right about the trial and error and frustration!
I'm getting there, though...
Retrieving data ...