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

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

Recommended Posts

Posted

Hi all, I have been 'lurking' for a while and reading the many informative and interesting posts on the forum but I thought it was time to get involved. I am very new to FM and have enjoyed getting to grips with it. I do have a problem though and since googling has returned little of benefit I was wondering if what I am after is actually possible! So to the problem...

I have two field Colours (Red, Green, Blue) and Size (Large, Small, Medium). I would like to produce a layout where checkboxes allow multiple selections to be made from each field and then to allow a find of those records.

So for example I could search for

-Red OR Green AND Small

-Red AND Small OR Medium.

I hope this makes some sense as I seem to have been going around in circles with this for quite some time!

Posted (edited)

FileMaker handles OR searches using multiple Find requests. E.g. you'd enter Find mode, select Red, then create a new request and select Green. Throwing AND into the mix, that field would need to be included in all the OR requests.

Your first example would use the requests:

- Red AND Small

- Green AND Small

Your next example would use the requests:

- Red AND Small

- Red AND Medium

If you want to bypass FileMaker's Find interface to work as you described, you'd probably use global fields for the checkboxes and a script would parse them into multiple Find requests.

Edited by Guest
welcome to the forums.
Posted (edited)

Thanks for the swift reply. I have seen on a previous posting the allocation of a global script to a set of checkboxes (see below) but I am perplexed as to how I can take a set of global values and form a script to perform the AND/OR process.

$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

Edited by Guest
Posted (edited)

The basic idea is that you need to set both fields in each Find request. We grab the first size, then combine that with each color. Then we grab the next size and combine that with each color, etc. (Actually this example starts from the last value and works its way to the top of the list.) The outer loops sets the size; the inner loop creates the Find Requests. You could switch size to the inner, color to the outer, it will have the same result.


Set Variable( $c ; ValueCount( gColours ) )

Set Variable( $s ; ValueCount( gSize ) )

Enter Find Mode

Loop

  Exit Loop If( $s = 0 )

  Set Variable( $size ; GetValue( gSize, $s ) )

  Set Variable( $s ; $s - 1 )

  Loop

    Exit Loop If $c=0

    Set Field( Colours ; GetValue( gColours, $c )  )  

    Set Field( Size ; $size  )

    Set Variable( $c ; $c - 1 )

    New Request

  End Loop

End Loop

Edited by Guest
not tested!
  • 2 years later...
Posted

Ignore this post--I wasn't thinking; the answer is above.

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