Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Filtering and Conditional Behavior

Status
Not open for further replies.

wchestnut

Programmer
Aug 9, 2010
79
US
I have a table in a Browse window that I need to be able to show all records and have two options to filter out records by a specific code (Employee Type: Current, Former or both).

I added the Employee Type and all variable fields to the Hot Fields list so the Browse window does refresh. When both the Current and Former checkboxes are selected, all records are displayed correctly.

However, if only the Current or only the Former checkbox is checked, it either displays no records or only one. In the Conditional Browse Behavior screens, I have the Condition and Key to Use set (which is Lastname, Firstname, Employee Type). When I try to use Record Filter, I always get a runtime error about the field not being BIND, but I have the Employee Type and variables set in the Data and Embed areas included in the Hot Fields tab with the BIND option selected.

So, I gave up on that and have been trying to use the Range Limit Field (Employee Type) and Range Limit Type which is set to a variable that is set to the respective Employee Type codes.

When both types are selected, the first record is a Former employee. If I select the Former checkbox, only that Employee's record is displayed. The same happens if I have a Current record selected with both options checked, then I uncheck the Former box. So it is filtering but only displays the current record.

The attachment here shows the Browse window with the Conditional Behaviors. Current and Former checkbox variables are EMPselected and XEMselected respectively. The EMPcode in Range Limit Value is set to 'EMP' in this case that's previously set in an Embed.

I understand it might be difficult for you to understand this from an outside point of view so let me know if you have any questions.
 
FYI - The error that appears when I try to use Record Filtering is:

View Open Error
Error: (No BIND on variable (801)) attempting to open the current VIEW. Filter and Range Limits ignored.
 
Hi!

The first thing you need to do is add CHOICE(?EmployeeTab) = 1 AND before the 4 conditions starting with EMPSelected.

Have you marked the FILE as Bindable in the dictionary. This will allow all the columns to be used in Filters without an explicit BIND. Otherwise, you need to BIND all variables (Columns or Local Variable) if you want to use them in a filter.

Please post the KEY columns of the Key used in the Range. Also, post the filter you tried to use.

Regards
 
Okay, I'm starting with your first recommendation to add CHOICE, but that caused another question. I need the Current and Former filters available for all 3 tabs, so will I need to do that for each CHOICE where I'll end up with 12 Conditional Behaviors (4 checkbox possibilities times 3 tabs)?
 
MAKING PROGRESS!

I answered my last question -- yes I did have to go back and add more Conditional Behaviors for each tab.

While I was replying here again about your request to post KEY columns of the Key used in the Range, I started to think and tinker around again. After a while, I have virtually everything working except for a sorting problem.

Something told me the Contact_Type field had to be the first in each Key in order for the Limit Range to work. So, I went back and modified my Keys for Days until Birthday and Days until Anniversary and included the Contact_Type as the first field in the Key list. That's works if you select Current OR Previous checkboxes. But if you select both, the sort is by Contact Type, then Days until X. If I move the Contact Type field below the Days of X field in the Key, then the Browse window only shows a couple of records.

Make sense?
 
Okay, I cheated. I created new Keys with just the Days until X fields in the Key to Use when both Current and Formal are selected. Everything works now.

This seems like a waste of Keys, and I'm probably not doing it properly, but it works.

Thanks, again, ShankarJ!
 
Hi!

Since the Conditional Behavior allows you to CHANGE the key used, you would use the key with Employee_Type when one of the Former/Current check boxes are ticked but you can use any other key like First Name, etc when BOTH are ticked (since you are no longer filtering on Employee_Type).

Is this a legacy or ABC APP?

Regards
 
Hi!

If you choose Application -> Properties from the menu, does the Application template say "Clarion" OR "ABC"? Clarion means Legacy or non object-oriented procedural code.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top