The entity name must immediately follow the '&' in the entity reference

Kumar38
Kilo Sage

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/>')

 

 

 

1 ACCEPTED SOLUTION

Kumar38
Kilo Sage

As this piece of code is used as embedded code within .setPreference , used additional replaceall 

 

g_form.getValue(VariableName).toString().replaceAll('\n', '<br/>').replaceAll('&', '&amp;')

View solution in original post

3 REPLIES 3

Karan Chhabra6
Mega Sage
Mega Sage

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!

I checked these and they are set to true already

Kumar38
Kilo Sage

As this piece of code is used as embedded code within .setPreference , used additional replaceall 

 

g_form.getValue(VariableName).toString().replaceAll('\n', '<br/>').replaceAll('&', '&amp;')