Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi,

My solution includes a set of conditional value lists for selecting a type and subtype for each record. Some of you have been a great help before with these value lists, but now I have a problem in find mode.

For searches, I need to show the type and subtype values as checkboxes, because a search may include multiple types. However, if my search is for multiple types, I want to mask the subtype choices from the user. As an example, if the types are types of food, I might select fruit as the type and then strawberries and mangoes under subtypes. But if I select fruit and vegetables, then I do NOT want to show all the subtypes of both food types. This would be a broad search and the subtype level of granularity would not make sense. Also, in my solution I have many types and subtypes and showing all would make for a cluttered interface.

The default FM behavior in FIND mode is that if the user selects >1 type, all the subtypes corresponding to the top level checkboxes selected are shown. I would like to show NO subtypes when >1 or 0 types are chosen (though I could live with the default "" message in the subtypes field when 0 types are chosen).

SO... I created different search layouts to show or not show the subtype fields, and wrote a script that selects the layout (using valuecounts) based on which checkboxes are selected in the type fields. I invoke the script using an "on object modify" script trigger on the type field (I'm using FM10).

Now for the frustrating part... it works perfectly in BROWSE mode, but NOT in FIND mode.

If someone would point me in the right direction on how to achieve what I discuss above, I would be most grateful...

Carlos

Posted

You cannot use checkboxes in Find, because that searches for records that have all the values checked in the field. If you need to search for multiple types in one Find, then you need multiple find requests.

Posted

Here is a Sample of what I think you are after...

It uses global fields and script triggers ( fm10 required - or modify with a plugin)

Global fields evaluate in both modes (find / browse) so that you can have your value lists show up...

This shows how to do it with either a Menu / Check Box / Radio Button, however in find mode the latter two will show on the second two menu options during your selection they will revaluate.

Using a conditional formatting i was able to make it not as visible when the the 2nd or 3rd menu options have not been selected.

Hope this helps...

Radio_Check_Value_in_Find_Mode_.fp7.zip

Posted

Thanks!

I haven't had time to look at it yet but from your description it sounds like your method will do the trick or take me a good way towards what I want.

Carlos

Posted

Stephen,

I stumped. First, I noticed in your solution that selecting multiple values in your checkbox 1 gives me all the relevant subchoices in box 2 (both browse and find modes). Not sure if this is the intended behavior. This is actually what is happening to me by default (with no script triggers or global fields), and what I need to change.

What I'd like to do is have a script trigger that switches between layouts in FIND mode. The various layouts either show or don't show the 2nd and 3rd checkboxes. If the user selects 1 value in the 1st checkbox, I want them to see the 2nd box (and if 1 value in 2nd, to see the 3rd). But if 0 or >1 values are selected in box 1, I want to go to the layout that does NOT show box 2, etc. In my scenario, it does not make sense to show the subchoices if >1 top level choice is made. Also, this way I get rid of the "" message when there are no subchoices.

Following your suggestion, I added a new global field and tried using a script variable to populate it with a number that points to the appropriate layout (layout 1, 2, etc.), and then a set of if statements that take the user to the layout based on the number in the global field. I put this in a script trigger (on modify) in the appropriate checkboxes. Again, it works in browse mode but not find.

Any idea what I might be doing wrong that it does not work in find? Or is what I'm after simply not possible?

Any additional pointers would be great...

Thanks,

Carlos

Posted

You know.. I was so intrigued by the possibility of a solution from Stephen's suggestion that I didn't really think about what you meant. But based on what you say, my whole approach is wrong.

So would it be possible to set up an interface allowing the user to select multiple checkboxes and then run the multiple find requests via a script? If so, how could I "collect" the user's choices for retrieval by the script? The values in the checkboxes come from a set of conditional value lists which are used to assign each record to a particular set of categories and subcategories.

Thanks,

Carlos

Posted

I like the idea of using tabs, but based on the previous post it would appear my whole approach is wrong, since doing a find on multiple values in checkboxes will search for records that have all the selected values (e.g., all records that have both FL "AND" NY for the state).

Since what I want is all records with FL "OR" NY, my approach won't work. This means I'd have to string together a sequence of finds (extending each time).

Is there a function to capture (in browse mode) all the the values selected in a checkbox field in which multiple values may be selected? If so, I may be able to script the sequence of finds.

Thanks,

Carlos

Posted

I see you wish to do OR searches?

check out this technique....

http://fmforums.com/forum/showtopic.php?tid/201295/

Posted

This technique searches Across fields for the same value. It's close, but not what Carlos needs exactly.

s there a function to capture (in browse mode) all the the values selected in a checkbox field in which multiple values may be selected? If so, I may be able to script the sequence of finds.

No, there is no function, per se. I understand that you don't want users to select mismatches, and it is a much nicer interface to have your subtypes limited by the type selected in find. However, perhaps it'll be OK. Maybe they won't select mismatches--or will learn not to when they don't find records. I probably would leave the type and subtype non-conditional value lists in find mode.

That being said, you could add a big "OR" button, that'll do a New Request for them. Then, they specify another Type and Subtype or perhaps just a Type. Then they click the Perform Find button, which resumes your Find script.

Scripting Find can be very limiting, as you'll need to ensure that you've thought of all combos and provided all the fields needed to search. I usually leave Find Mode pretty basic.

Now, you could offer a Find layout that is really a set of global fields in browse mode. Then you can run a script that has the logic of:

Enter Find Mode

if not empty global1

set field field1 to global 1

endif

if

blah

endif

Perform Find

Posted

bcooney,

Your last suggestion is exactly where I'm headed (I think). I appreciate your advice about keeping Find simple. But I'd like to give this a shot and see where it takes me. The only hangup is capturing just the values that the user selects when the value list is presented to them in a checkbox. What I need is a function sort of like ValueListItems, that returns selected values instead of all the values in the list.

Would it make sense to reproduce the values from the list individually in separate fields, present each field as a 1-value checkbox (in browse), and then use your technique to determine if the user has selected it? I could then string together the selections to construct a find. If this seems really stupid, please let me know. I'm still a novice banging my head around a lot.

Thanks again!!

Carlos

Posted

If you use the idea of a global text field in browse mode, formatted to use your Type value list as checkboxes, then you will have a field that contains a return-sep list of Types that they are searching for.

Given this list, you can loop thru the contents of the global. Something like

$counter = ValueCount (gType)

Enter Find Mode

loop

exit loop when $counter=0

Set Field Type = getvalue (gType, $counter)

set variable $counter - $counter-1

New Request

endloop

I'm just writing this off the top of my head. If I have time today, I'll put together a demo. Try it.

Posted

This sounds right.. but I can't seem to get it to work. Not sure I understand the relationship between this global text field and the records being searched. I added this global field to the table that holds all the records, and formatted it to show the checkbox set for the same value list that I use to select the value for each record, and in the "display data from" window I selected the field that contains those values for each record. Does that sound right?

Posted

Yes, good so far. So now you have, on a separate layout which you'll use for entering the find criteria, a global field that displays your checkbox set.

Now you need to write a script that performs the find, creating a new request and setting the Type field for each value in the global field.

Posted

yes this is it!

I have to step out now so I will have to study it later, but it looks like a very elegant solution.

much obliged!!

cheers,

Carlos

  • 3 months later...
  • 4 weeks later...
Posted

This is so slick. I used the basic idea behind it with script triggers to make for real-time filtering.

One feature I'd love to be able to add is to switch the search from an OR to an AND find, in case some of the dresses can be "blue, red" for example.

I'd like it to be switched on/off with a toggle, but I'm having trouble making it as elegant as the rest of your method.

This topic is 5611 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.