If however you have a complex query that you need to build on the fly there is no way to display this.
I have a query which usually has one criteria in it, but sometimes has two or more, e.g.
Code: Select all
FIND Job WHERE EXISTS JobMechanic WHERE (JobMechanic.obJob=Job AND JobMechanic.Name = 'Jacob'
Code: Select all
FIND Job WHERE EXISTS JobMechanic WHERE (JobMechanic.obJob=Job AND JobMechanic.Name = 'Jacob')
AND EXISTS JobMechanic WHERE (JobMechanic.obJob=Job AND JobMechanic.Name = 'Carl')
I can't see a way to build that inside a query and you can't use EXEC_SCRIPT in a query formula to build the FIND statement outside the query place it into a non persisted BO and then EXEC_SCRIPT TempBO.QString.
You can use
Code: Select all
DISPLAY Job WHERE EXISTS JobMechanic WHERE (JobMechanic.obJob=Job AND JobMechanic.Name = 'Jacob')
AND EXISTS JobMechanic WHERE (JobMechanic.obJob=Job AND JobMechanic.Name = 'Carl')
What would be useful is to be able to define the layout of a query and then be able to use
Code: Select all
DISPLAY Job WHERE EXISTS JobMechanic WHERE (JobMechanic.obJob=Job AND JobMechanic.Name = 'Jacob')
AND EXISTS JobMechanic WHERE (JobMechanic.obJob=Job AND JobMechanic.Name = 'Carl')
USING MyQuery
to override the query's FIND and insert the BOs that you've brought into context with the DISPLAY statement but laid out in the format of MyQuery.
Unless anyone else has encountered a way to make this happen another way.