3 Replies Latest reply on Oct 22, 2014 6:24 AM by philmodjunk

    Set Variable With Calculated Field Name?

    SteveFransen_1

      Title

      Set Variable With Calculated Field Name?

      Post

      Can I set a variable to a value based on a calculated field name?

      Here's what I want to do...

      Set Variable [ $TableName; Value: "ExampleTableName" ]

      Set Variable [$Variable; Value: $TableName & "::field" ]

      When I do this $Variable is set to the text string "ExampleTableName::field" rather than the contents of ExampleTableName::field

      Thanks

        • 1. Re: Set Variable With Calculated Field Name?
          SteveMartino

          It's giving you the results you asked for by putting things in quotes.

          For $TableName try   Get ( ActiveFieldTableName ). 

          I don't understand what you are looking for.  Do you want the value of the contents in a field to set to a variable, or do you want the dynamic TableName::Field to use in a variable?

          For Example if I have a table "Customers' and a field "Account_status" and its marked 'Unpaid, this calculation:

          Get ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) &  " = " & Get ( ActiveFieldContents )

          results in this:

          Customers::Account_status = Unpaid

          • 2. Re: Set Variable With Calculated Field Name?
            SteveFransen_1

            I don't understand what you are looking for.  Do you want the value of the contents in a field to set to a variable, or do you want the dynamic TableName::Field to use in a variable?

            I want the dynamic TableName::Field to use in a variable.

             Get ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) &  " = " & Get ( ActiveFieldContents )

            I think I understand. This step in the script is called when a user clicks a button, in a portal row, on a panel, on a popover, so I need to try this and make sure the focus is on the correct field when the click occurs.

            Thanks

            • 3. Re: Set Variable With Calculated Field Name?
              philmodjunk

              If it's always the same field, take a look at getfieldname.