1 Reply Latest reply on Nov 28, 2013 6:28 AM by philmodjunk

    Script to change data formatting



      Script to change data formatting




           I'm trying to write a script however I'm pretty new to filemaker to have no clue!

           I've got a field called "existing/new" and a field called "structural opening".

           Existing/new is a drop down list with the options "existing" and "new".

           I want the "structural opening" field to say "As existing" if "existing/new" is set to "existing" (managed this part so far).

           If it says "new"  then it allows a numerical value input in the "structural opening" field with a "mm" post-fix notation (eg. 950mm).

           The problem I'm having is that to get the "as existing" to appear, I have to set the data formatting to general.


           Any help is greatly appreciated.




           P.s. My script currently:

      Set Field [ Door Schedule::Existing New ]

      If [ PatternCount ( Door Schedule::Existing New ; "Existing" ) ]

      Set Field [ Door Schedule::Structural Opening["As Existing"] ]

      End If

        • 1. Re: Script to change data formatting

               You've put "as existing" in the wrong place.

               When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

               But I'd use a conditional format with "As Existing" placed on the layout as layout text. The conditional format would be set to hide/reveal the text by setting the font size to 120+ points to make it invisible when the text does not apply.