Using check boxes on a single column to filter data

Al Dinelt

Member
I have a created a custom table in OneWorld Xe. Within the table is a column for determining the status of the record (e.g. Journalled, Pending, Error, Invalid, etc.).

I would like to use check boxes on a form to filter which records appear on the data grid. I have dropped four checkboxes on the form and associated the Database Item for the Status column for each check box.

However, only one check box will work at a given time. As soon as I check more than one box, no data will be retrieved in the data grid. For instance, if I check only the Pending check box, I get all records that have a Pending Status. If I check only the Invalid check box, I get all records that have an Invalid Status. But, if I check both Pending and Invalid check boxes, I get no data at all.

Does anyone know if this is possible and if so, how would I go about accomplishing this? Unlike radio buttons, check boxes are not mutually exclusive, so I would think this should work.

Thanks in advance...
ald
 
ald,

If I understand your situation correctly, what is happening is that with multiple checkboxes checked, the SELECT SQL statement produced links the checkbox criteria with a logical AND instead of a logical OR, producing a SQL like this:

Where Status_col = 'Invalid'
AND Staus_col = 'Error'

This will return nothing. What you need is for the checkboxes to produce a SQL using a logical OR like this:

Where Status_col = 'Invalid'
OR Staus_col = 'Error'

The sad part is I'm not sure that the OR can be set. You may need to put some ER into the event Grid Record Is Fetched to mimic the OR selection.

I hope I have helped. All the best for a solution.
 
Hi Al,

Maybe you can try to play with:

Set Selection Append Flag
Set Selection

system functions (Grid category) in the Button Clicked event of Find button. In this case you have to disconnect the checkboxes from the BSVW columns.

Regards,

Zoltán
 
Thanks for the help folks. I got a response back from Global Support and the check boxes will not work the way I want, even though the are not mutually exclusive. When I took a look at the SQL that was being generated in the debug log, all check boxes were being AND'ed together.

I tried the Set Selection Append Flag method and had limited success with it. I changed the associations on the check boxes to Data Dictionary Items instead of Database Items. Then in the Button Clicked event for the Find button, I did the append method, then based on the status of the check box, added the appropriate Set Selection function. It seemed to work the first time, but when tested with the other filters on the form, the other filters seemed to be ignored.

I think what I will do is use the check boxes to filter out which records will be displayed on the grid instead of acting as a filter in the selection SQL. Not the cleanest and most efficient way of doing this, but it will visually give me the effect I am after.

Thanks again for all your help...
Al
 
Hi Al,

Previously I forgot to say you: Welcome aboard on JDEList!
cool.gif


Just a question, because I am curious:
Does the Set Selection method ignores the QBE filtering too OR does it work well with it, with a bracketed AND relation?

In the second case, maybe we can figure out an alternative solution.

Regards,

Zoltán
 
Back
Top