- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2015 08:24 AM
I am trying to using a onChange Client Script to clear the value of the Assigned To field when the Assignment Group changes. I tried to use the one that was posted on the messages, but it is not working.
Here is what I have:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if (newValue == ''){
g_form.setValue('assigned_to','');
}
}
This is not working, any suggestions?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2015 10:07 AM
Hi Vinay,
Below script will blank out the assigned_to field when the assignment group changes.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
var assGrp = g_form.getControl('assignment_group');
if(assGrp.changed)
{
g_form.setValue('assigned_to','');
}
//Type appropriate comment here, and begin script below
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2015 10:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2015 10:57 AM
Try a condition of newvalue != oldvalue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2021 03:32 AM
Simply useful script. Thank you..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2015 10:10 AM
Pradeep is right. I just noticed the flaw in your logic. You're looking ONLY for when the new Assignment Group is null, which will practically never happen. It might work if you switch your statement to newValue != oldValue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2015 10:59 AM
Thanks to you and Pradeep, it is working now. I figured out that the field name was not correct in the Client Script.
Once again, thanks for all your prompt responses