2 Replies Latest reply on Jan 23, 2015 12:39 PM by aspectmedia

    Set Field by Name does not work with variable



      Set Field by Name does not work with variable


      I am trying to dynamically set a container field by established relationship, so that a number of fields can use the same script.

      Having trouble getting a field to "set by name". Any help would be much appreciated

      I have a container filed and a text field. The container field runs a "onObject Enter trigger for the following script:

      Set Variable[$$thisField; Value:Get(ActiveFieldName)]
      Commit Records/Requests      // to exit the field. Script did not work even with this step deleted
      Set Field [Table::zTempField;$$thisField]      // to confirm the variable was set (for testing only)
      Show custom Dialog [Table::zTest choice]     // an input box that sets a choice for the relationship
      If [not isempty(Table::zTest Choice
         Set Field By Name [$$thisField; MyRelationship::TheRelatedfield]   // the relationship works, just not this step
      End If

      This script works when "Set Field" is used instead of set-by-name. So the problem seems to be, in setting the field by name using the variable. Is it a problem of calculation? Somehow FMP cannot read the field name out of the variable. Any "extraction" advise?