Giter Club home page Giter Club logo

Comments (11)

mech avatar mech commented on July 23, 2024 1

Oh better not for sec and privacy concern. The XML file should be enough :)

from filemaker-ruby.

mech avatar mech commented on July 23, 2024

Quite strange, what's the data type for DaysWorkdaysInWeek?

Do you have the <metadata> XML where we can inspect, like this?

<metadata>
    <field-definition auto-enter="yes" four-digit-year="no" global="no" max-repeat="1" name="status" not-empty="no" numeric-only="no" result="text" time-of-day="no" type="normal"/>
</metadata>

from filemaker-ruby.

alydersen avatar alydersen commented on July 23, 2024

The metadata looks like this:

<metadata>
<field-definition auto-enter="yes" four-digit-year="no" global="no" max-repeat="1" name="_id" not-empty="no" numeric-only="no" result="text" time-of-day="no" type="normal"/>
<field-definition auto-enter="no" four-digit-year="no" global="no" max-repeat="1" name="_id_Country" not-empty="no" numeric-only="no" result="number" time-of-day="no" type="normal"/>
<field-definition auto-enter="yes" four-digit-year="no" global="no" max-repeat="1" name="DaysWorkdaysInWeek" not-empty="no" numeric-only="no" result="number" time-of-day="no" type="normal"/>
<field-definition auto-enter="no" four-digit-year="no" global="no" max-repeat="1" name="ShortName" not-empty="yes" numeric-only="no" result="text" time-of-day="no" type="normal"/>
</metadata>

I have been trying out different data types in the model, but with no change

from filemaker-ruby.

mech avatar mech commented on July 23, 2024

Your data type for DaysWorkdaysInWeek and _id_Country are both number, maybe you can try number or integer:

  • number are Ruby's BigDecimal under the hood, good for money or floating point
  • integer are just plain integer
string :supplier_id, fm_name: '_id', identity: true
integer :country_id, fm_name: '_id_Country'
string :shortname, fm_class: 'ShortName'
number :workingdays, fm_class: 'DaysWorkdaysInWeek'

Other than that, you can write some debug statement at this file: https://github.com/mech/filemaker-ruby/blob/master/lib/filemaker/metadata/field.rb to see if that help.

from filemaker-ruby.

alydersen avatar alydersen commented on July 23, 2024

Thanks for your help so far!

So I made the coerce function output both the value and the datatype, and it returns it just fine:

2.3.4 :006 > Supplier.first
curl -XGET 'https://.../fmi/xml/fmresultset.xml?-db=...&-lay=web__Supplier_Rails&-max=1&-findall=' -i
ETHON: performed EASY effective_url=https://.../fmi/xml/fmresultset.xml response_code=200 return_code=ok total_time=0.021081
SU000005
text
259
number
5
number
ANS
text
SU000005
259.0
ANS
 => #<Supplier:0x007f94cdac9428 @new_record=false, @attributes={"supplier_id"=>"SU000005", "workingdays"=>nil, "country_id"=>"259.0", "shortname"=>"ANS"}, @relations={}, @record_id="6", @mod_id="1480", @portals={}> 

I've changed the data type to number and integer with no effect.
Any more hints?

from filemaker-ruby.

mech avatar mech commented on July 23, 2024

Are you able to provide me with the whole XML file with your private information removed so that I can put it through the spec to run some test?

from filemaker-ruby.

alydersen avatar alydersen commented on July 23, 2024

Here you go:

<fmresultset xmlns="http://www.filemaker.com/xml/fmresultset" version="1.0">
  <error code="0"/>
  <product build="4/5/2017" name="FileMaker Web Publishing Engine" version="16.0.1.184"/>
  <datasource database="..." date-format="MM/dd/yyyy" layout="web__Supplier_Rails" table="..." time-format="HH:mm:ss" timestamp-format="MM/dd/yyyy HH:mm:ss" total-count="161"/>
  <metadata>
    <field-definition auto-enter="yes" four-digit-year="no" global="no" max-repeat="1" name="_id" not-empty="no" numeric-only="no" result="text" time-of-day="no" type="normal"/>
    <field-definition auto-enter="no" four-digit-year="no" global="no" max-repeat="1" name="_id_Country" not-empty="no" numeric-only="no" result="number" time-of-day="no" type="normal"/>
    <field-definition auto-enter="yes" four-digit-year="no" global="no" max-repeat="1" name="DaysWorkdaysInWeek" not-empty="no" numeric-only="no" result="number" time-of-day="no" type="normal"/>
    <field-definition auto-enter="no" four-digit-year="no" global="no" max-repeat="1" name="ShortName" not-empty="yes" numeric-only="no" result="text" time-of-day="no" type="normal"/>
  </metadata>
  <resultset count="161" fetch-size="2">
    <record mod-id="1480" record-id="6">
      <field name="_id">
        <data>SU000005</data>
      </field>
      <field name="_id_Country">
        <data>259</data>
      </field>
      <field name="DaysWorkdaysInWeek">
        <data>5</data>
      </field>
      <field name="ShortName">
        <data>ANS</data>
      </field>
    </record>
    <record mod-id="1390" record-id="7">
      <field name="_id">
        <data>SU000006</data>
      </field>
      <field name="_id_Country">
        <data>243</data>
      </field>
      <field name="DaysWorkdaysInWeek">
        <data>5</data>
      </field>
      <field name="ShortName">
        <data>CCE</data>
      </field>
    </record>
  </resultset>
</fmresultset>

from filemaker-ruby.

mech avatar mech commented on July 23, 2024

Oh FileMaker 16. I do not have it. I only have FM 15. I may need to upgrade first. Probably something changed between the version. I will test it regardless and let you know the outcome.

from filemaker-ruby.

alydersen avatar alydersen commented on July 23, 2024

Want me to create a user for you on our system for testing purposes?

from filemaker-ruby.

alydersen avatar alydersen commented on July 23, 2024

I'm so sorry, but this is a typo on my end. In the model, I'v managed to type fm_class instead of fm_name. It worked beautifully when I changed that.

Sorry again for the trouble caused!

Andreas

from filemaker-ruby.

mech avatar mech commented on July 23, 2024

Oooo.. great

from filemaker-ruby.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.