April 5, 20178 yr 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
April 6, 20178 yr Are you referring to correct TO in the "Else if"? Check the TO of the layout which the script is running at the time.
April 6, 20178 yr Author 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!
April 7, 20178 yr Yet another example of why it is useful to have fields set up to use the auto-enter calc: trim( textFormatRemove( self ))
Create an account or sign in to comment