<script custom-tag="" type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Embedding Reports In Jelly throwing errors related to 'GlideList2 is not defined'","image":"http://support.servicenow.com/29f1d2661baf6010cafa53d8624bcb43.iix","author":{"name":"ServiceNow Support","url":"http://support.servicenow.com/now"},"keywords":"ServiceNow, NowSupport public Knowledge Base articles, Known Error,KB0830031,","wordcount":"270","publisher":"ServiceNow","url":"https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0830031","datePublished":"2020-07-06","dateCreated":"2020-06-25","dateModified":"2024-04-08","description":"<h2>Embedding Reports In Jelly throwing errors related to 'GlideList2 is not defined'</h2><br/><div style=\"overflow-x:auto\"><h2>Description</h2><div><p>You can embed reports in any Jelly-based element","articleBody":"<h2>Embedding Reports In Jelly throwing errors related to 'GlideList2 is not defined'</h2><br/><div style=\"overflow-x:auto\"><h2>Description</h2><div><p>You can embed reports in any Jelly-based element, such as a UI page.</p></div><h2>Steps to Reproduce</h2><div> <p></p><ol style=\"list-style-position: inside;\"><li>Create new list report:</li><li>Navigator to Reports --&gt; Create New</li><li>Create a new list report and copy the sys_id.</li><li>Create UI Page:</li><li>Type &#39;UI Pages&#39; in filter navigator.</li><li>Create a new UI page with the following HTML code.</li></ol>\r\n<pre style=\"padding-left: 80px;\">&lt;?xml version&#61;&#34;1.0&#34; encoding&#61;&#34;utf-8&#34; ?&gt;<br />&lt;j:jelly trim&#61;&#34;false&#34; xmlns:j&#61;&#34;jelly:core&#34; xmlns:g&#61;&#34;glide&#34; xmlns:j2&#61;&#34;null&#34; xmlns:g2&#61;&#34;null&#34;&gt;<br />&lt;g:inline template&#61;&#34;reporting_includes.xml&#34; /&gt;<br />&lt;div id&#61;&#34;report_stuff&#34; /&gt;<br />&lt;script&gt;<br />var div &#61; $j(&#34;#report_stuff&#34;);<br />embedReportById(div,&#39;ef319e251b9d941060e699c01a4bcb7e&#39;);<br />&lt;/script&gt;<br />&lt;/j:jelly&gt;</pre>\r\n<p style=\"padding-left: 40px;\">7. Now, click on &#39;Try It&#39;.<br />8. Inspect the page and navigate to the console tab. </p>\r\n<p><br />Errors:<br />-- Observe errors in console logs as below<br />VM616:1 Uncaught ReferenceError: GlideList2 is not defined<br />at eval (eval at evalScript (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:81), &lt;anonymous&gt;:1:12)<br />at evalScript (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:81)<br />at _executer (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:67)<br />at _executer (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:68)<br />at _executer (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:68)<br />at _executer (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:68)<br />at _executer (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:68)<br />at _executer (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:68)<br />at _executer (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:68)<br />at _executer (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:68)<br />VM611:7 Uncaught ReferenceError: GlideList2NewHandler is not defined<br />at f (eval at evalScript (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:81), &lt;anonymous&gt;:7:5)<br />VM614:1 Uncaught ReferenceError: GlideWidgetVCR is not defined<br />at eval (eval at evalScript (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:81), &lt;anonymous&gt;:1:26)<br />VM615:1 Uncaught ReferenceError: GlideWidgetHideOnEmpty is not defined<br />at eval (eval at evalScript (js_includes_doctype.jsx?v&#61;06-01-2020_0932&amp;lp&#61;Thu_May_28_22_08_08_PDT_2020&amp;c&#61;6_88:81), &lt;anonymous&gt;:1:26)<br /></p>\r\n<p><img style=\"align: baseline;\" title=\"\" src=\"sys_attachment.do?sys_id&#61;4eb6a4a6db02b450e515c22305961944\" alt=\"\" width=\"831\" height=\"446\" align=\"baseline\" border=\"\" hspace=\"\" vspace=\"\" /></p></div><h2>Workaround</h2><div><p>We have a workaround for this embedReportById issue:</p>\r\n<ul style=\"list-style-position: inside;\"><li>Add <span style=\"font-family: &#39;courier new&#39;, courier;\">&lt;g:inline template&#61;&#34;list2_js_includes.xml&#34; /&gt;</span> to the UI page code and errors in the console will be resolved.<br /></li></ul>\r\n<pre>HTML Code:<br />&lt;?xml version&#61;&#34;1.0&#34; encoding&#61;&#34;utf-8&#34; ?&gt;<br />&lt;j:jelly trim&#61;&#34;false&#34; xmlns:j&#61;&#34;jelly:core&#34; xmlns:g&#61;&#34;glide&#34; xmlns:j2&#61;&#34;null&#34; xmlns:g2&#61;&#34;null&#34;&gt;<br />&lt;g:inline template&#61;&#34;reporting_includes.xml&#34; /&gt;<br /><strong>&lt;g:inline template&#61;&#34;list2_js_includes.xml&#34; /&gt;</strong><br />&lt;div id&#61;&#34;report_stuff&#34; /&gt;<br />&lt;script&gt;<br />var div &#61; $j(&#34;#report_stuff&#34;);<br />embedReportById(div,&#39;a1849841c611227b01646de563508c09&#39;);<br />&lt;/script&gt;<br />&lt;/j:jelly&gt;</pre></div><div><br /><strong>Related Problem: PRB1411595</strong></div></div>"}</script>
  Loading...