Dana G Posted June 25, 2013 Posted June 25, 2013 Purpose: To capture the contents of a field before it is changed. Compare the before to the after. Highlight the after and screen capture then export. I can't get past the first sentence and it's getting frustrating because it seems extremely simple. 1 Field: OnDeck_t (text) - The OnDeck_t field data = On 2 Field: OnDeck_before (Where I want to capture the OnDeck_t before it's changed) I have an OnObjectEnter script trigger on the OnDeck_t field that runs this script: Set Field By Name [substitute (Get (ActiveFieldName); "_t"; "_Before"); Get (ActiveFieldContents)] If I do this it works fine. (But I don't want it hard coded. I will be using it for all the fields on the layout): Set Field [OnDeck_before; Get (ActiveFieldContents)] I have divided the Substitute (Get (ActiveFieldName); "_t"; "_Before") and Get (ActiveFieldContents) into separate lines in Data Viewer and both return expected results. Why doesn't it work when it's part of a 'Set Field by Name' script step? Thanks.
Rick Whitelaw Posted June 25, 2013 Posted June 25, 2013 You should have your trigger create a variable, perhaps $before, that consists of the text before anything is typed.
Dana G Posted June 26, 2013 Author Posted June 26, 2013 OK I created a script called "Before". It has one step: Set Variable [$before; Value: Get(ActiveFieldContents)] There is an OnObjectEnter script trigger on the OnDeck_t field (On; Off Radio buttons) with the "Before" script set. From what I understand, the "Before" script should run after I click into the OnDeck_t field, making it active. The script should set the $before variable to 'On' which is it's current contents. It doesn't work. The variable is blank. Any ideas?
IdealData Posted June 26, 2013 Posted June 26, 2013 $vars (local variables) only exist for the duration of the script and are lost once the script terminates - hence yours is blank You need to use a $$var (global variable) - these remain in place until the file is closed.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now