5 Replies Latest reply on Jul 6, 2011 4:14 AM by RichardG_1

    Substitute text in current field rather than a specific field

    ErichWetzel

      Title

      Substitute text in current field rather than a specific field

      Post

      Running a script which I hope to run on the showing tab in a layout.  Each tab has a different text field.  I want to run the same substitution regardless of which tab is showing.

       

      SetVariable $fieldname = Get(ActiveFieldName)

      Goto next field

      Set field ( $fieldname ; Substitute ( Table::$fieldname ; [ "Road" ; "Rd" ] ; [ "Avenue" ; "Ave" ] ; [ "Street" ; "St" ] ; [ "Pike" ; "Pk" ] ; [ ":00" ; "" ]))

       

      The calculation I am setting up in the script will not recognize the variable from the script when closing the calculation window.

       

      My workaround is to test for which field the active one is and then use a series of If/else steps run the version of the substitute above for the appropriate field.  That means that I have an identical substitute line for each field.  

       

      Is there a way to set up substitution line to do the abbreviations above and run it on the currently active field?