AnsweredAssumed Answered

Script setting a variable with the contents of a field

Question asked by Abingdon on Nov 10, 2015
Latest reply on Nov 10, 2015 by Abingdon

 

Hi All,

I am writing a script to set a global variable with the contents of a field using the OnObjectEnter script trigger as I need to capture the current value in that field before it is changed.

There are four fields on the layout to which I want to apply this trigger.  It works fine when the fields are formatted as drop-down lists, but not when they formatted as drop-down menus.  I understand that the script trigger behaves differently depending on whether it is applied to a drop-down list (the script will run first) and a drop-down menu (the script runs after a value is selected).  I believe I need to pass the value in the field as a parameter, Get(ScriptParameter) but I am damned if I can figure out how.

The drop-down list script is:

Set Variable [$$Content; Value: GetField (“MyActualFieldName”)]

 

So far for the drop-down menu version I have:

Set Variable [$$Content; Value: Get (ScriptParameter)]

 

I attach that to the field with the Script Parameter as follows:

GetField(GetFieldName(Evaluate(Get(ActiveFieldName))))

 

I get a question mark returned as the data.  Clearly not doing it right.

As mentioned I need to use this script on multiple fields so a single script for all would be good.

Many thanks as always.

 

Abingdon

 

 

 

Outcomes