Clear Assigned to value on change of Assignment Group

lucky6
Tera Contributor

Hi,

After changing of Assignment Group" , Assigned to field should be clear. How can i achieve this with below scriptings.

1.Client Script

2.Business Rule

 I tried Onchnage Client script but it is not working

11 REPLIES 11

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

g_form.setValue('assigned_to', '');

}

uma7
Kilo Guru
You can use g_form.clearValue("assigned_to");

p_espinar
Kilo Guru

If you make the assigned_to field dependen of assignment group, if you change the group and the assigned-to is not in that groups it is automatically cleared. No need of scripts, BR, and so on.

Un saludo,
Pablo Espinar
Consultant at Econocom Spain

Please mark this response correct if I've answered your question. Thanks! 

Sudhanshu Talw1
Tera Guru

//Check this

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

    if (isLoading || newValue === '') {

          return;

    }

else{

g_form.setValue("assigned_to","");

}

 

Thanks

Sudhanshu

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Did this solve your question? Or do we need to follow-up on this?

Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn