Jump to content

Find Request based on Check Box Set with Similar Name Values


This topic is 1803 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello, 

I have an interesting problem that I can't seem to figure out.  

I have a database of fire trucks, each truck gets its own record in the Apparatus table.  within the apparatus table there is a field for what "Group" that fire truck falls into.  The field is a checkbox set because an apparatus can be in multiple groups.  In this instanced a fire truck can be a LADDER or it can be a TOWER LADDER.  They are very different types of apparatus so searching for them would be important.   Right now the way I built the script if I search for LADDER I get a return of LADDER and TOWER LADDER records.   Is there a way to tighten up the search parameters so this overlapping return doesn't happen?  Here are some screen shots of what the SEARCH PAGE looks like and the script.  

Thank You! 

Chris Konash

863509457_ScreenShot2019-11-14at2_04_56PM.thumb.png.e6373dba24f69530379e0e592eea90e6.png1503573336_ScreenShot2019-11-14at2_04_33PM.thumb.png.73b2925e67cdcf382edd869bfe7537d2.png

 

Posted

I am a little confused by your description. You seem to have two checkbox fields: one for checking the groups that a truck belongs to; the other - a global field - for checking the groups you want to find. 

If this is correct, what do you expected to find if you check more than one box in the global field? All the trucks that belong to any of the groups checked, or only trucks that belong to all the checked groups?

 

Posted

That's a great question.  Sorry I didn't think to describe that a little more in the original question.  When checking a global field checkbox and then searching the apparatus for matching records I am interested in matching the individual boxes and Not all of the boxes between the global and apparatus field.   The issue I was having is that the find request if I were to check the "Ladder" global field, after the find request, would return all the apparatus records that were checked off as a "Ladder" and "Tower Ladder" .  Is there a way to only return the "Ladder" trucks and not have it find the "Tower Ladder" trucks, even though it has Ladder in the description?  

This could also happen if the global search field is checked off for "Engine".  After the current method of searching is performed it would return the apparatus with either "Engine" or "Rescue - Engine" checked off in the apparatus records.  

I was hoping that if "Engine" is checked off as a global search, that only the apparatus with the matching check box are found. 

I hope that makes sense.  

Thanks, 

Chris.

Posted

I understand the issue you describe. But there are two additional factors here that complicate your situation. You have three separate requirements that influence each other: 

  1. You want to do an OR find - if you check both "Ladder" and "Engine", you expect to find items in any of these types. For this, you would need to create a separate find request for each checked value. I don't see this in your script.
  2. You want to find an exact match - "Ladder" does not find "Tower Ladder". This would be easy to accomplish by prepending the search criteria with the == exact match operator. However, this cannot work in your situation, because:
  3. You have items that belong to more than group. Searching for "==Town Ladder" will not find an item that is both a town ladder and some other group.

Now, all these issues can be solved by some intricate means - but I would suggest you take the easy way out. Define a self-join relationship of the Apparatus table as:

Apparatus::gGroup = Apparatus 2::Group 

Then start your find by:

Go to Related Record [ from Apparatus 2; Show only related records ]

and continue by entering Find mode, setting all the other fields to their criteria, and constraining the found set.

--
A few additional notes:

  • Showing all records before performing a find does not accomplish anything.
  • Global fields retain their values in Find mode; you don't need to transcribe them to variables.
  • When you enter Find mode, your 1st request is already created for you.

 

  • 3 months later...
Posted

Hello Comment, 

I finally had a chance to implement and test your suggestions and boom. they worked first shot.  Not that I had any doubts in your instructions, only my ability to follow along and do things correctly.   

One question.   The Go to Related Records / Find Request is searching through about 1000 fire truck records,  I noticed it's a bit slow, maybe 15-20 seconds to complete.   I'm guessing that is because of the related record part since a normal find request (the old way, wrong way) was relatively quick.  Any semi easy ways to speed up the search / related record process that you can think of?   

Thanks again!  

Chris

 

Posted

You are asking me to guess, and I don't like to guess. Although it's very tempting to speculate that your GTRR step has the Match all records in the current found set option selected. If not, post a file showing the problem (preferably minimized to show only the problem).

 

This topic is 1803 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.