apinrise Posted April 5, 2017 Posted April 5, 2017 Hi everyone. Strange behavior happening with my script that I can't determine the source of: I have a dropdown list on my Loans layout that triggers a script. The dropdown TEXT field is set to a simple Yes or No, and when changed, triggers this script. At the beginning of my script, I pass the value of the dropdown field to a variable "$returned". It correctly receives the selected value. And the value correctly matches that of the field Loan Sale::Returned. However, when I go to test the variable, or even the original field-- If($returned="Yes") or by testing If(Loan Sale::Returned = "Yes) --it does not validate. I even use a Show Custom Dialog box with the values of both $returned and Loan Sale::Returned, and both appear as "Yes". The field is definitely set to Text, and I even tried GetAsText($returned) to see if that would = "Yes" but it doesn't pass the test. I tried passing a Commit Records step at the beginning of the script in case there was a cached value, but this didn't solve anything either. The screenshots show the valuue being "Yes", and then I proceeded to Step-Into the statement and you can see it skips over without returning true. Thanks for the help, Ryan
siroos12 Posted April 6, 2017 Posted April 6, 2017 Are you referring to correct TO in the "Else if"? Check the TO of the layout which the script is running at the time.
apinrise Posted April 6, 2017 Author Posted April 6, 2017 12 hours ago, Wim Decorte said: spaces or trailing returns in the value? oh my god....yes. I hadn't considered that, but there was a trailing white-space character after the Yes value. thanks for pointing out the obvious!
bruceR Posted April 7, 2017 Posted April 7, 2017 Yet another example of why it is useful to have fields set up to use the auto-enter calc: trim( textFormatRemove( self ))
Recommended Posts
This topic is 2786 days old. Please don't post here. Open a new topic instead.
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