- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 04:25 AM - edited 05-29-2023 08:31 AM
I have a OnSubmit Client script that calls a UI Page and client script throws the below error:
The entity name must immediately follow the '&' in the entity reference.
g_form.getValue(VariableName).toString().replaceAll('\n', '<br/>')
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 08:34 AM
As this piece of code is used as embedded code within .setPreference , used additional replaceall
g_form.getValue(VariableName).toString().replaceAll('\n', '<br/>').replaceAll('&', '&')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 04:50 AM
Hi @Kumar38 ,
Set both these system properties to true and check again:
- glide.ui.escape_all_script
- glide.ui.escape_text
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0656916
If my answer has helped with your question, please mark it as correct and helpful
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 04:51 AM
I checked these and they are set to true already
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 08:34 AM
As this piece of code is used as embedded code within .setPreference , used additional replaceall
g_form.getValue(VariableName).toString().replaceAll('\n', '<br/>').replaceAll('&', '&')