- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2014 10:24 AM
I have been working on this for a while and need some help.
We are wanting the State field to change to Active (2) when the Assignment Group changes to anything. Also, The Assigned to should blank out when the Assignment Group changes (I havent started coding this part yet).
i have gotten to the point that the system will notify me that the field changed, but will not update the other fields.
Here is my code so far:
function onSubmit() {
var field1 = g_form.getControl('assignment_group'); //Get the 'Assignment Group' field control
//See if the 'changed' attribute on either field is true
if(field1.changed) {
return confirm("Assignment Group on the form have changed.\nDo you really want to save this record?");
if (stateValue != '2'set stateValue =='2';
}
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2014 10:54 AM
Hi Maurie
Here you go..
Script:On change client script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
if(newValue != oldValue)
{
var answer = confirm("The Assigned Group on the form have changed.\nDo you really want to save this record?");
if (answer == true) {
g_form.setValue('state',2);
g_form.setValue('assigned_to','');
return true;
}
else
{
return false;
}
}
Please let me know if you have any further questions
Good luck!
Thanks
Pradeep Sharma
Service now certified implementation specialist
Cognizant

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2014 10:54 AM
Hi Maurie
Here you go..
Script:On change client script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
if(newValue != oldValue)
{
var answer = confirm("The Assigned Group on the form have changed.\nDo you really want to save this record?");
if (answer == true) {
g_form.setValue('state',2);
g_form.setValue('assigned_to','');
return true;
}
else
{
return false;
}
}
Please let me know if you have any further questions
Good luck!
Thanks
Pradeep Sharma
Service now certified implementation specialist
Cognizant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 07:10 AM
thank you so much for your help. This fixed my problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 07:14 AM
I am glad I can be helpful to you
Would you mind marking my answer as correct.
Thanks,
Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2016 01:15 AM
Hi pradeep,
i too have same question..when i am changing the assignment group on incident from state is zero.why?