OR filter for 1 field

5 views
Skip to first unread message

RH

unread,
Apr 11, 2010, 9:29:35 AM4/11/10
to RFM Community
Hi, may i ask if i can perform multiple search for 1 single field
using the .find method? For example i want to find all records with
status "Pending" or "Closed". I have no problem with just 1 condition
method.
.find({"Status" => "Active"})

wbr

unread,
Apr 11, 2010, 3:41:13 PM4/11/10
to rfmcom...@googlegroups.com
Filemaker's XML interface supports this kind of complex logic, but it's my understanding that RFM does not implement it (yet). It requires some freaky programming in ruby to create the proper XML request logic.

I have a patch I created a long time ago to allow OR logic within a field during a RFM find. This works well for my specific needs, but I haven't tested it extensively. Nor has anyone else ever used this... so usual disclaimers apply: you're on your own. That said, I welcome feedback. If others have success with this, perhaps it could be worked into the main project. When I wrote it, I had all kinds of visions for extending the RFM query logic even further. But so far, my needs have not required anything more.

The patch adds the method Rfm::Layout#query. Use the 'query' method instead of 'find' when you have OR logic within any particular field. Use an array of values as the OR'd find criteria for that field. I believe this works for any number of OR'd values within any number of fields.

Use: rfm_layout_object.query({'fieldOne'=>['val1','val2','val3'], 'fieldTwo'=>'someValue', ...})

Here's the patch. Tip-O-the-hat to Larry, Geoff, and all the other contributors to RFM.

Bill


http://pastie.org/914503

lardawge

unread,
Apr 11, 2010, 8:54:12 PM4/11/10
to RFM Community
I will try to work this in to the next release. I have been buried
with work and progress has stalled but will continue soon...

RH

unread,
Apr 11, 2010, 10:17:51 PM4/11/10
to RFM Community
great! thanks! Will look forward for the releases.
Reply all
Reply to author
Forward
0 new messages