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

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

Recommended Posts

Posted

Maybe I'm confusing myself, but I'm still getting used to how to make Find calls using the FM PHP API and could use some help.

I have a table with 4 fields: Date, City, Size, Status.

And I have a form where a user can filter the data by checking off one or more of those field values.

So for example the use could check off a number of checkboxes to make the filter criteria:

Date: 08/30/2011…08/30/2011

City: Los Angeles, San Francisco

Size: 100x200, 100x300

Status: Active, Disabled

If all these record combinations existed, I would get back the results:

08/30/2011 LA active 100x200

08/30/2011 LA disable 100x300

08/30/2011 LA disable 100x200

08/30/2011 LA active 100x300

08/30/2011 SF active 100x200

08/30/2011 SF disable 100x300

08/30/2011 SF disable 100x200

08/30/2011 SF active 100x300

This type of request doesn't work because each 2nd request of the same Field, simply overwrites the parameters:

$request->addFindCriterion('Data', '07/26/2009...07/26/2009');

$request->addFindCriterion('City', 'Los Angeles');

$request->addFindCriterion('City', 'San Francisco');

$request->addFindCriterion('Size', '100x200');

$request->addFindCriterion('Size', '100x300');

$request->addFindCriterion('Status', 'Active');

$request->addFindCriterion('Status', 'Disabled');

So now I'm looking at doing a CompoundFind Search.

But then does that mean I need create 8 CompoundFind's to get these results?

My actual data, has about 80 different Cities, 10 size's and 4 statuses. If every option was selected, I would need A LOT of CompoundFind requests, wouldn't I?

Is there a better way I should handle this? Or is this how I need to do it?

If it were SQL, I would simply do:

SELECT *

FROM table

WHERE Date = '2009-07-26'

AND City IN ('Los Angeles', 'San Francisco')

AND Size IN ('100x200', '100x300')

AND Status IN ('Active', 'Disabled')

Thanks.

Posted

So just in case someone ever stumbles across this thread.

What I ended up doing with this was creating a table and writing my criteria to a field for each (each value seperated by a new line), then created several table relationships for the data and then displayed it as a portal in a layout.

As my criteria changes, I just edit the record in my table and the relationship and thus my portal, displays exactly what I'm after.

I think I just wrapped my head around how FileMaker makes it's data work :) Cool!

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