Confirm Dialog box in Servicenow

KS86
Tera Contributor

Hi all,

I have one requirement.

I have one field called group on the catalog form. 

We have one MRVS, it contains filed group. Group field will be populated with value based on the Group field on the catalog form. 

 

Requirement -

Select group on the form, add values in MRVS. Then if we try to change the group field , it has to show one Confirm Message("If you change the group, it will clear the all rows in MRVS").

1. If user click "Ok", MRVS rows has to be cleared and Group has to show with new Group Value. (Working as expected now)

2. If user clicks on "Cancel", Group has to show the Old Group only. 
Currently #2 is not working as expected.

 

g_form.setValue('u_group', oldValue); // This is not working. 

Please let me know if you guys have any thoughts on this. Thanks!

 

8 REPLIES 8

Ankur Bawiskar
Tera Patron

@KS86 

you didn't share complete script and screenshots

So can't help

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

KS86
Tera Contributor

I can't share that due to confidentiality.

KS86
Tera Contributor
    if (g_form.getValue('assignment_group')) {//if assignment_group MRVS has values

        if (confirm("Changing group will clear your rows in MRVS. Continue?")) {
            g_form.clearValue('assignment_group');
        } else {
            alert(oldValue);
            g_form.setValue('u_group', oldValue);
        }
Here is the script , that's all I can share
    }

@KS86 

so "assignment_group" is variable within MRVS?

what's u_group?

without these details it's difficult to understand

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader