sunbird Posted March 18, 2007 Posted March 18, 2007 I am trying to write a script that performs a find using values entered in checkboxes. For example, for a field which holds languages spoken (English, French, Spanish, etc.) how would I perform a find for all records listing French? Many thanks in advance,
bcooney Posted March 18, 2007 Posted March 18, 2007 The field that has the languages spoken is a text field that is formatted for checkboxes and uses a value list that contains the languages spoken choices, correct? Possible script: enter find mode [pause] (user enters their find criteria during the pause) perform find[] put a button on your find layout "Perform Find" that is set to Resume script. Depending on your interface, you could dedicate a layout for finding (since you don't want the "Perform Find" button on your data entry layout) or use the data entry layout and have the user click the continue button to have the script perform the find.
Raybaudi Posted March 18, 2007 Posted March 18, 2007 Hi you can even perform a find with a relationship ( w/o a script ) languages_spoken.zip
Genx Posted March 18, 2007 Posted March 18, 2007 Hi Daniele, That will work, but if the user searches French and English (meaning they want the person to speak both french and english) a GTRR on a multi-key returns people who speak french or people who speak english (people who speak french and english exist as a subset). Just a general note -- That's why i hesitate to use checkboxes for anything but boolean values... or where a user will only ever search one value or where an "OR" GTRR will suffice. On the other hand... you could use a global field and a small patterncount function if only 4 languages are ever spoken (or a CF for completley dynamic)... Anyway then you just search the calc field -- but it's not indexable so that's slow as hell for large record sets.
Raybaudi Posted March 18, 2007 Posted March 18, 2007 Hi Genx I noticed that you changed your avatar... but what is it ?
Genx Posted March 19, 2007 Posted March 19, 2007 http://en.wikipedia.org/wiki/Praying_mantis I just like it cause it's head is turned funny... Like a puppy that doesn't understand something.
Raybaudi Posted March 19, 2007 Posted March 19, 2007 ... but if the user searches French and English like this ? BTW: The female praying mantis is known for her habit of biting the head off her partner while they are mating languages_spoken.zip
Genx Posted March 19, 2007 Posted March 19, 2007 Can't check at the moment but probably LOL Re: the praying mantis, yes i know that, think it is a good representation of what happens with people too, not literally but... (jking)
Genx Posted March 19, 2007 Posted March 19, 2007 Neat... but what if i want to just find someone who speaks english?
Raybaudi Posted March 19, 2007 Posted March 19, 2007 If you want to find someone who speaks english ( AND possibly other languages ) you can go on with the first example's search If you want to find someone who speaks english ( AND no other other languages ) you can go on with the secon example's search ;)
Genx Posted March 20, 2007 Posted March 20, 2007 Yes... but what if i want to do both?.. obviously not at once but at different times?
Recommended Posts
This topic is 6458 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 accountSign in
Already have an account? Sign in here.
Sign In Now