Lee Irving
|
| Posted: 10/29/2002, 2:27 AM |
|
I would like to use a grid with some fixed agruments in the where clause. For example I want to select records where the following is true:
TrngAppDateOffer is not null and (TrngAppDateAccept is null and TrngAppDateWithdraw is null )
However I would also like to allow the user to filter via a search box. I cannot seem to add the fixed criteria as above and the dynamic search criteria supplied by the argument list.
When I switch the grid to SQL type the arguments are there however they are always requested rather than if there is only a value set.
Any ideas on how to work around this ?
Regards
Lee
|
|
|
 |
Lee Irving
|
| Posted: 10/29/2002, 3:05 AM |
|
Ok I think I have a workaround. In the Grid Prepare() function I have added the following line of code
$this->Where = $this->wp->opAND(false, $this->Where, "TrngAppDateOffer is not null and (TrngAppDateAccept is null and TrngAppDateWithdraw is null )");
This seems to do the trick and I will try it out. Any cleaner methods ie without hacking the core code would be appreciated.
|
|
|
 |
Steven
|
| Posted: 10/29/2002, 4:04 AM |
|
can this not just be done by adding the details into the grid properties, sql, where statement at the top of the sql page, above sort by xx
TrngAppDateOffer != null and (TrngAppDateAccept == null and TrngAppDateWithdraw == null )
or similar
Steven
|
|
|
 |
Lee Irving
|
| Posted: 10/29/2002, 4:55 AM |
|
I probably should have mentioned that I was using CCS 1.0.7
and PHP although the later does not matter that much
|
|
|
 |
Nicole
|
| Posted: 10/30/2002, 6:57 AM |
|
Lee,
It is pretty easy in CCS. You should create Where clause using parameters of different types. Open form DataSource dialog and:
1. to add fixed Where parameter like
field1 = null
set 'Condition Type' to "Expression" and enter necessary conditions into 'Expression' field;
2. to add Where parameters with values passed via URL, set 'Condition Type' to "Parameter" and fill the 'Field' and 'Parameter Source' settings
|
|
|
 |