
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2017 05:49 AM
Hello,
I've been tasked with another request to create an OnChange script which once something is inputted into a different field it triggers
the OnChange script and changes the value in a different field.
For example,
State: 1
name : <nothing>
after changes:
State: 2
name: Jordan Thompson
From this, you can see a name was imputted and the state changed from "1" to "2".
Thanks,
Jordan
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 04:47 AM
Hi Jordan,
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var check= g_form.getValue('state');
var ad=g_form.getValue('assigned_to');
if(check=='2' && ad != '') //assumed "root couse required" value is 2. you can check this value at your end from choice .
{
g_form.setValue('state','<your state value that you want to set>');
}
}
Let me know if it does not help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 12:53 AM
Hello Harsh,
Looking at the screenshot below you can see the state field and the assigned too field.
What I want the script to do is:
If "Root Cause Required" is selected and a name is selected in the assigned too field, I want this to trigger a script where it changes the state field to "Root Cause Analysis".
Thanks,
Jordan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 04:47 AM
Hi Jordan,
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var check= g_form.getValue('state');
var ad=g_form.getValue('assigned_to');
if(check=='2' && ad != '') //assumed "root couse required" value is 2. you can check this value at your end from choice .
{
g_form.setValue('state','<your state value that you want to set>');
}
}
Let me know if it does not help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 05:29 AM
Big Thanks,
This worked great.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2017 08:46 AM
This happens today out of the box. Initial state is New, but once someone is assigned, the State changes to In Progress.