- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2014 06:46 AM
I have the below script set to run on load to automatically set a selectbox, it does not seem to be working, Does anyone know if this will not work on a variable set? I only have two choices available Values 1 and 2
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setValue('install_group',2)
}
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2014 12:18 PM
I got it fixed, thank you all for your help, turned out to be a corrupt variable set, I had to rebuild it and it is working now.
JJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2014 06:47 AM
Hi,
try this:
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setValue('variables.install_group',2)
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2014 06:49 AM
Hi ,
use variables or variable_pool object and then use to set value to particular variable set variable .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2014 06:50 AM
If the choice value is an int:
g_form.setValue("variables.install_group", 2 )
If the choice value is a string:
g_form.setValue("variables.install_group", "2")
If the target field is a reference I would also recommend specifying the displayvalue in order to avoid extra server call.
g_form.setValue("variables.install_group", "sys_id", "displayValue")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2014 08:24 AM
Like others are saying, the variable name is probably the issue. Try just alerting on it to see what you get?
alert(g_form.getValue('install_group'));
Does it pop up undefined or blank? If it does the variable name is probably the issue.