Field value is not setting after clicking on yes in confirm box onSubmit client script

SnehaSaran15
Tera Contributor

I have the requirement to set the value of assignment group coming from Script include. On submitting the form a confirm box pops up where if the user clicks on ok it sets the assignment group field value(say ABC) as displayed in the confirm box otherwise if cancel is clicked it the assignment group field keeps the previous original value(say XYZ). So whenever the form is loading after record creation the assignment group field first show the previous original value(XYZ) and then it refreshes to the new value(ABC) if Ok was selected in the confirm box during record creation. In the list view the record has  the previous original value(XYZ) of assignment group. 

 

How can I make sure if Ok is clicked on the confirm box then it sets the new value of assignment group(ABC) correctly?

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@SnehaSaran15 

are you submitting the form after setting the value?

why not save the form using g_form.save() in UI page client script if you are using UI page

how are you rendering the pop-up?

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

Hi Ankur,

We are using On Submit Client script where we are first getting response from script include and then using confirm box to ask the agent whether they want to set Assignment group as predicted by PI and if they click ok then we are setting the value of the assignment group as predicted.