error on UI Page: 'The entity "nbsp" was referenced, but not declared '
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2017 09:48 AM
I have an HTML field (u_related_information) on a custom table and I want to display it's contents on a UI Page. I can get it to correct render the contents in some instances, however If the field contains I get an error when rendering the Page. 'The entity "nbsp" was referenced, but not declared.'
Any ideas how I can correct this?
Below is my code
<g:evaluate var="sysparm_detail_sysid">
var sysparm_detail_sysid = RP.getParameterValue("sysparm_detail_id");
sysparm_detail_sysid;
</g:evaluate>
<g:evaluate var="jvar_system_status" jelly="true">
var sysStatus = new GlideRecord('u_it_daily_system_status');
sysStatus.addQuery('sys_id', jelly.sysparm_detail_sysid);
sysStatus.query();
</g:evaluate>
<j:while test="${sysStatus.next()}">
<div class="detail">
<div><span class="${sysStatus.getValue('u_icon').toLowerCase()}">System:</span>${sysStatus.getDisplayValue('u_system')}
</div>
<div><span class="detaillabel">Related Information:</span><g:no_escape>${sysStatus.u_related_information.getHTMLValue()}</g:no_escape>
</div>
</div>
</j:while>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2017 10:43 AM
Hi David,
you see variable "sysStatus" has been covered up by "jvar_system_status" in following code:
<g:evaluate var="jvar_system_status" jelly="true">
var sysStatus = new GlideRecord('u_it_daily_system_status');
sysStatus.addQuery('sys_id', jelly.sysparm_detail_sysid);
sysStatus.query();
</g:evaluate>
And in the next series of code, you are still using "sysStatus", which is no longer present.
You might want "sysStatus" to be replaced by "jvar_system_status" your next evaluate code, something like this:
<j:while test="${jvar_system_status.next()}">
<div class="detail">
<div><span class="${jvar_system_status.getValue('u_icon').toLowerCase()}">System:</span>${jvar_system_status.getDisplayValue('u_system')}
</div>
<div><span class="detaillabel">Related Information:</span><g:no_escape>${jvar_system_status.u_related_information.getHTMLValue()}</g:no_escape>
</div>
</div>
</j:while>
Hope this would help ya!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2017 12:00 PM
Thanks for your reply. Originally I had it setup as you advised and displayed a blank section.
The issue I am encountering is when the html field contains nbsp;
For example, if the html field's contents are:
The UI Page displays:
However if I remove the from the html contents:
The UI Page displays:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017 08:40 PM
In ServiceNow UI Page, you can use this ---   ---- This wont give any error.
Kindly mark correct/helpful if it helped you in anyway. Thanks!