I was trying to write a client script and was tying the below:

gsindhu26
Tera Contributor

 

var ans = confirm(" The customer is notified of all P1 incidets.Confirm basic information is collected before submitting
this P1 incident. \n\nSelect OK to submit or Cancel to return to the record ");

 

I am getting error for this and return. May be its because they are keywords, but what should be the replacement of such words in my statment.

gsindhu26_0-1694607479185.png

 

1 ACCEPTED SOLUTION

aman_sharma_07
Tera Guru

Hi @gsindhu26 ,

 

I think you must try pressing backspace before "this" or rewrite the whole string again.

 

Thanks!

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@gsindhu26 

should not be an issue. the message within confirm box should accept any keywords.

it's breaking since you are giving \n which is a new line character and it won't work there. Also you cannot use html tag such as <br/> to add new line.

Just remove \n\n and it will start working

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

aman_sharma_07
Tera Guru

Hi @gsindhu26 ,

 

I think you must try pressing backspace before "this" or rewrite the whole string again.

 

Thanks!

gsindhu26
Tera Contributor

Yes i was so stupid... It was a silly one. Thanks for it