2 Replies Latest reply on Apr 28, 2016 9:36 AM by ScottBleackley

    Count works on OS X but not iOS

    ScottBleackley

      FMGo 14.04 iPad 9.3.1 (13E238) 128GB 95 available
      FM Pro A 14.05 OS X 10.11.4

       

      Use in a script of Count ( tableName::FieldName ) returns a value in OS X but only ? in iOS
      Same code different behaviour.

       

      In the code sample below values are put into existing fields UTM Zone, Easting, Northing
      for diagnostic purposes on FMGo ( would love debug and data viewer on iPad )

       

      On OS X for the true if condition I get values 1, 1, 4 for the else condition 0, 0, 5 as it should be.

      On FMgo for the true if condition I get values 1, ?, 4 for the else condition 1, ?, 4 which is not correct.

       

      Critical issue.  Any work arounds possible?
      I need to know if there are any related records in the tableName,
      since it is a list of 23 thousand unique values there will only be one match if any.

      Screen Shot 2016-04-27 at 1.47.45 PM.png

       

      Thank you

        • 1. Re: Count works on OS X but not iOS
          TSGal

          ScottBleackley:

           

          Thank you for your post.

           

          Without seeing your file, it is difficult to determine why this is failing.

           

          Try putting the "Count" into a variable.  Also, since "Form 2::Easting" is going to be the "Count" regardless of the condition, set the value outside the condition.  Thirdly, if the condition is true, there is no reason to evaluate it again for Form 2::UTM Zone since you know the result.  For example:

           

          Set Variable [ $count ; Count ( OpeningID::OpeningIDNumber ) ]

          Set Field [ Form 2::Easting ; $count ]

          If [ Form 2::IdentifierType ≠ "OpeningID" or (Form 2::IdentifierType = "Opening ID" and $count > 0 ) ]

             Set Field [ Form 2::UTM Zone; 1 ]

             Set Field [ Form 2::Northing ; 4 ]

          Else

             Set Field [ Form 2::UTM Zone ; 0 ]

             Set Field [ Form 2::Northing ; 5 ]

             Set Field [ Form 2::Opening ID ; "" ]

             Show Custom Dialog [ .....

          End If

           

          -----

           

          If you are still getting a "?" for Form 2::Easting, is it happening for all records that don't have related records?

           

          TSGal

          FileMaker, Inc.

          • 2. Re: Count works on OS X but not iOS
            ScottBleackley

            There is indeed a difference in processing between OS X and iOS, however it is different than I thought.

             

            Problem Solved:  Although there is still a difference between OS X and iOS functionality.

             

            Turns out the the secondary table in the relationship had Opening ID defined as a number while the

            primary table in the relationship had the related field, Opening ID as a text field.

             

            Count works on OS X when this is the case but does not work on iOS when this is the case.

             

            When I change Opening ID in the secondary table to a text field, Count then works on iOS.

             

            Thank you for your response, it made me think this through a little differently.