- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2018 06:02 AM
Hi,
I'm trying to script, so that when I choose an option in two different select box variables (Environment and Version), the "target server" variable will have a specific text (for single line text), or maybe set the choice if I use select box.
I have done the following so far:
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2018 06:53 AM
Double check your using the correct field names in your getters and setters. Also add some alerts throughout the code to see where the script is breaking.
I have a feeling this could be the condition which triggers the client script. You want to change the variable name to either environment or version. This way the client script is triggered when one of those is changed, not onChange of the target server field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2018 06:10 AM
In order to get the value of the environment and version fields you'll want to use g_form like so:
var env = g_form.getValue('db_environment');
var ver = g_form.getValue('dbversion');
Also keep in mind when getting and setting choice fields, you're getting the value of that choice not the label. So if the value of SQL Server 2014 is '3', you'll want to change your if statements to reflect that value. If you were to set that choice fields value, you'd do it like so: g_form.setValue('dbversion', '3');
Let me know if this helps,
Dylan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2018 06:41 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2018 06:53 AM
Double check your using the correct field names in your getters and setters. Also add some alerts throughout the code to see where the script is breaking.
I have a feeling this could be the condition which triggers the client script. You want to change the variable name to either environment or version. This way the client script is triggered when one of those is changed, not onChange of the target server field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2018 07:16 AM
Hi Dylan.
The latter suggestion made it work!!!! THANKS A LOT!!!