4 Replies Latest reply on Aug 16, 2012 5:57 AM by beverly

    Ruby, Rfm, and Scripts in a Separated vs One-File Model

    jpolk5000

      Howdy,

      Where to start?, lol...

       

      Currently, I have a working setup where using Ruby and Rfm, I can log into our FMP server

      and retrieve record data, do various ops,etc. The data I get back is XML data in fmResultSet grammar.

      This is all working well....works both in a "one file" and a "separated" model databases.

      (Btw, we're using FMP 10.0v1)

       

      Moving to the next required step for us: script execution

      Meaning a FMP script..one that is defined in FMP, and "lives" in the database.

       

      Our "real" database is a separated model...but I'm using test databases at the moment.

      One of them is very simple "one file" database. Another one is clone of the real DB,

      and is a "separated model" db.

       

      Using Ruby and Rfm, I can execute a command sequence that will launch and run

      a script in the **TEST** database...the "one file" model.

       

      ( Btw, I've also been using browser command/request sequences to test things..like:

      http://###.###.##.##/fmi/xml/fmresultset.xml?-db=This_TempDB&-layoutnames

      )

       

       

      However, when I try to do the same the same Ruby script on a test database that is a

      *separated model* type, I get back a "FieldMissingError"...

       

      My main question is...Should I be connecting to, and running the script on, the "GUI" file or the "DB" file?

      Do the scripts live in both files?...or just the "GUI" file?

       

      The way the Ruby script works, is that it must find the specified field, before it can issue the Ruby

      command to run the FMP script...so..

      Do I need to query the "DB" file to get locate the right field, then execute the script in the "GUI" file?

       

       

      Also, slightly related...(showing my unfamilarity with FM)...is there any rule of thumb

      to handle the tilde ("~") in Layout names?...Does it need to be escaped with "" ?

      Should the tilde be eliminated in all Layout names? Any other rules of the road that one needs to know

      pertaining to tilde (or other special characters) syntax?

       

      Thank you,

      JPolk