I'm using GetDate and the onGetDate script. I modify ModifiedDate to be in a different format. However this is never saved back to the result variable. Is it supposed to save back? Currently I'm using this statement to work around, but I wasn't sure if this was the intended behavior or not.
I think the problem is here is that ActionProperties.ResultVariable only allows you to reference the name of the variable specified in the action, it cannot be used to assign a value to this variable.
The easiest way to achieve what you want to do is:
FBVariables.MyVariable = ModifiedDate;
Or you can also use the FBFormatDateTime function in this statement:
My eval statement actually achieves what I’m trying to accomplish. What I am avoiding is having to place the variable I want to use in the dialog AND in the script events. I copy and paste my actions around a lot and having to remember that I need to change a variable name in 2 places is inconvenient at best.
My question is about the function of OnGetDate. Is ModifiedDate intended to be a read only value, or should modifying it cause my Result Variable to change. I would think the latter, but I wanted to check since it is not clear in the help file.
Sorry for the misunderstanding, I can see your reason for doing this now.
ModifiedDate is read only, any value that you assign to this within the OnGetDate event will have no affect. I would recommend assigning this to a local variable within your script which you modify and include as a part of the eval statement.