OK - I have to come clean - I was simplifying the process to try to make things clear. It is more complicated.
We have a number of products, each product is bespoke and each has Cost Quote from multiple sources. But products are grouped and we can't place an order with the factory for some of the products in a group and not others.
You will see that it is not a question of accepting the lowest quote for each product, but the lowest overall.
The extra complication is that the customer may not order all the product in a group.
So the user has a screen based on a Product Group. All the Product/Quote combinations are related to the Product Group.
When they need to decide who they will order the goods from they have a Pick List using a Checkbox Widget, ordered by Product first then Factory. Using this they pick the Product/Quote (now called OrderLines) they want to include on the report.
Having made their selection they have a Panel Operation set to Create Document to create the report. This works fine but . . .
Embedded in this document is a subreport which provides a total of the quoted costs from each factory, this obviously has to be sorted and grouped by Factory.
The fundamental question is how can I reorder the Orderlines generated by the CheckBox Widget in the sub-report
I am pretty certain that I could start a process from the Checkbox widget to set a flag in the Orderline Record before making the CREATE DOCUMENT call. I could then extract the record I need in the subreport, but I am concerned about performance, the OrderLine Object will have many thousands of records.
So
FIND OrderLine WHERE Orderline.Flag = 'Y' ORDER BY FactoryName would be dangerous
So I tried
FIND OrderLine WHERE Orderline IN CostGroup.OrderLine AND Orderline.Flag = 'Y' ORDER BY FactoryName
But this found nothing - the CostGroup record in CONTEXT did not seem to be passed to the sub_report.
The concern is that perhaps this SHOULD work and perhaps I have made a silly error, how long to I spend looking for a slip which perhaps does not exists???
I'm stuck.
Thank you for your assistance. I am new to AwareIM and have a difficult application to develop. Baptism by fire . . .