Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of Operators #22

Closed
mtozlu opened this issue Mar 20, 2015 · 1 comment
Closed

Usage of Operators #22

mtozlu opened this issue Mar 20, 2015 · 1 comment

Comments

@mtozlu
Copy link

mtozlu commented Mar 20, 2015

Hi,
Thanks for this great gem. It has helped me save (and possibly many developers worldwide) weeks (possibly months) of coding time.

I would like to find records in FM server that have a date field greater than my value.
How can i achieve this?
It is stated in FM XML documentation that you send the "field.op" as query string. Here is a passage from docs:

For example, the following request searches for values greater than 100,000 in the “Salary” field
on the “Budget” layout. The resulting data is displayed using the “ExecList” layout, which does not
include the “Salary” field.

http://192.168.123.101/fmi/xml/fmresultset.xml?-db=employees
&-lay=Budget&Salary=100000&Salary.op=gt&-find&-lay.response=ExecList

In RFM i can only use ".find(:field => value)". How can i use comparison operators?
Thanks.

@mtozlu
Copy link
Author

mtozlu commented Mar 23, 2015

Actually i have experienced that one can send operators in the current rfm like this:

MyLayout.find({'my_field' => '1000', 'myfield.op' => 'gte'})

This would fetch all records that have "my_field" value greater then or equal to 1000.
Other operators can be found in FileMaker Custom Web Publishing documentation. You can also find not null, null, etc. other records. All of them are documented in FileMaker.

But again, it would be better to just write

MyLayout.find('my_field >= 1000')

@mtozlu mtozlu closed this as completed Mar 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant