<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Querying Related Tables sc_req_item and sc_cat_item in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875983#M532909</link>
    <description>&lt;P&gt;That is what I had in my previous comments&lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_emote jive_macro" data-renderedposition="8_287_16_16" src="https://www.servicenow.com/8.0.1.35b65d4/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 27 Jul 2016 20:29:12 GMT</pubDate>
    <dc:creator>Abhinay Erra</dc:creator>
    <dc:date>2016-07-27T20:29:12Z</dc:date>
    <item>
      <title>Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875962#M532888</link>
      <description>&lt;P&gt;My requirement is to pass in the "Requested Item number" and "requested item name" and check whether any records exist...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Noticed that name field is present in different table sc_cat_item... I m passing in the Requested item number and name from my client script.. This is the below code i m using... &lt;/P&gt;&lt;P&gt;but do we have an option to do dot walking and do this validation.. i tried it but it doesnt work... could any suggest how we can do it in simplied way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14696350387157048" data-renderedposition="155_8_1115_272" jivemacro_uid="_14696350387157048" modifiedtitle="true"&gt;&lt;P&gt;var reqDetails = new GlideRecord('sc_req_item');&lt;/P&gt;&lt;P&gt; &amp;nbsp; //var catItem = reqDetails.addJoinQuery('sc_cat_item');&lt;/P&gt;&lt;P&gt; &amp;nbsp; reqDetails.addQuery('number',g_form.getValue('request_number_2'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; //catItem.addCondition('name', 'Hardware Exception Appeal');&lt;/P&gt;&lt;P&gt; &amp;nbsp; reqDetails.query();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; //create and return the array of environments&lt;/P&gt;&lt;P&gt; &amp;nbsp; while(reqDetails.next()){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; var catItemData=new GlideRecord('sc_cat_item');&lt;/P&gt;&lt;P&gt; &amp;nbsp; catItemData.addQuery('sys_id',reqDetails.cat_item);&lt;/P&gt;&lt;P&gt; &amp;nbsp; catItemData.query();&lt;/P&gt;&lt;P&gt; &amp;nbsp; while(catItemData.next()){&lt;/P&gt;&lt;P&gt; &amp;nbsp; //do the logic over here&lt;/P&gt;&lt;P&gt; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jul 2016 15:59:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875962#M532888</guid>
      <dc:creator>kailashthiyagar</dc:creator>
      <dc:date>2016-07-27T15:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875963#M532889</link>
      <description>&lt;P&gt;I will recommend to use GlideAjax.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="http://wiki.servicenow.com/index.php?title=GlideAjax" title="http://wiki.servicenow.com/index.php?title=GlideAjax"&gt;GlideAjax - ServiceNow Wiki&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 16:03:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875963#M532889</guid>
      <dc:creator>Abhinay Erra</dc:creator>
      <dc:date>2016-07-27T16:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875964#M532890</link>
      <description>&lt;P&gt;Can you please let me know the need of this script? I &amp;nbsp; am unable to identify your aim.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Sourabh &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 16:04:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875964#M532890</guid>
      <dc:creator>sourabhd87</dc:creator>
      <dc:date>2016-07-27T16:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875965#M532891</link>
      <description>&lt;P&gt;Hi Sourabh,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;My requirement is, if the user enters in the request no(the one which he has already raised), we will be validating whether its a valid request number by querying against the requested item table&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 16:22:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875965#M532891</guid>
      <dc:creator>kailashthiyagar</dc:creator>
      <dc:date>2016-07-27T16:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875966#M532892</link>
      <description>&lt;P&gt;So best bet would be to use GlideAjax. As gliderecord use in client scripts not recommended.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Sourabh &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 16:29:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875966#M532892</guid>
      <dc:creator>sourabhd87</dc:creator>
      <dc:date>2016-07-27T16:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875967#M532893</link>
      <description>&lt;P&gt;Yes Sourabh.. we will be implementing the glide record functionality in Script include and will use glide ajax in the client script .. So ultimately, we will need to query tables.. rit?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 16:48:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875967#M532893</guid>
      <dc:creator>kailashthiyagar</dc:creator>
      <dc:date>2016-07-27T16:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875968#M532894</link>
      <description>&lt;P&gt;Yes you ill have to do all the querying stuff in the script include. Let me know if you need any help in scripting.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 16:50:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875968#M532894</guid>
      <dc:creator>Abhinay Erra</dc:creator>
      <dc:date>2016-07-27T16:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875969#M532895</link>
      <description>&lt;P&gt;Yes thats correct. Just that you can dot walk multiple times in script includes. As mentioned by Abhinay, let us know if any help is required. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Sourabh&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 16:54:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875969#M532895</guid>
      <dc:creator>sourabhd87</dc:creator>
      <dc:date>2016-07-27T16:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875970#M532896</link>
      <description>&lt;P&gt;Could you help me in how we can do this using dot walking for this scenario.. Just the code on the script include alone s enough&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 17:20:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875970#M532896</guid>
      <dc:creator>kailashthiyagar</dc:creator>
      <dc:date>2016-07-27T17:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875971#M532897</link>
      <description>&lt;P&gt;eg: you can do current.assigned_to.department.name to get the department name of the current assigned_to person on an incident form.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;In the same way you can replicate your scenario:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var reqDetails = new GlideRecord('sc_req_item'); &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;//var catItem = reqDetails.addJoinQuery('sc_cat_item'); &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;reqDetails.addQuery('number',"RITM0000016"); &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;//catItem.addCondition('name', 'Hardware Exception Appeal'); &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;reqDetails.query();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;reqDetails.next();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.addInfoMessage(reqDetails.cat_item.name); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // This will print the catalog item name&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.addInfoMessage(reqDetails.cat_item.vendor.name); // this will print out the vendor name which is on the catalog item&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Please mark the answer helpful or correct if you fell so.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Sourabh&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 18:14:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875971#M532897</guid>
      <dc:creator>sourabhd87</dc:creator>
      <dc:date>2016-07-27T18:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875972#M532898</link>
      <description>&lt;P&gt;Yes Sourabh.. we are not able to get the below one working.. its coming as undefined... So we are making second glide record query... we thought this dot notation should fetch the value but somehow its not..&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;gs.addInfoMessage(reqDetails.cat_item.name); &lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;"&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;reqDetails.cat_item" gives the Sys ID....&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;Then with the Sys ID, we are making second query to get the name... Its round about option:(&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 18:31:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875972#M532898</guid>
      <dc:creator>kailashthiyagar</dc:creator>
      <dc:date>2016-07-27T18:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875973#M532899</link>
      <description>&lt;P&gt;Hi Kailash,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I have already tested this script in business rule and it works well for me. Try writing a script include, pass the request number to the script include, and try returning the name of the cat_item. It has to work. Make sure to print out all the values you passed so that you are sure that you are passing correct values.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;IF possible paste your client script and script include here so that I can test.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Sourabh Dhaygude&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 18:38:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875973#M532899</guid>
      <dc:creator>sourabhd87</dc:creator>
      <dc:date>2016-07-27T18:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875974#M532900</link>
      <description>&lt;P&gt;If you can tell me your entire use case and what you are trying to achieve, I will code it for you. It is very straight forward.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 18:42:03 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875974#M532900</guid>
      <dc:creator>Abhinay Erra</dc:creator>
      <dc:date>2016-07-27T18:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875975#M532901</link>
      <description>&lt;P&gt;This is the script include and client script which i m using.. For testing purpose, i m just returning the name from the script include and adding an alert in the client script.. Hope that is clear.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Here is the script include&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;validateRequestNumber: function(){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var answer=false;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var reqNo = this.getParameter('sysparm_req_number');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var reqDetails = new GlideRecord('sc_req_item');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; reqDetails.addQuery('number',reqNo);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; reqDetails.query();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; //create and return the array of environments&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; while(reqDetails.next()){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; return reqDetails.cat_item.name;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Here is the client script&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;var ga = new GlideAjax('EUTSCatalogRITMValidation');&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;var reqNo=g_form.getValue('request_number_2');&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;ga.addParam('sysparm_name','validateRequestNumber');&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;ga.addParam('sysparm_req_number',reqNo);&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;ga.getXMLAnswer(validateReqNo);&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function validateReqNo(response) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; alert(response);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 19:56:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875975#M532901</guid>
      <dc:creator>kailashthiyagar</dc:creator>
      <dc:date>2016-07-27T19:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875976#M532902</link>
      <description>&lt;P&gt;Can you paste your entire script include here. You are missing class declarations here. &amp;nbsp; &lt;STRONG&gt;Did you check the client callable checkbox on the script include?&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 20:00:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875976#M532902</guid>
      <dc:creator>Abhinay Erra</dc:creator>
      <dc:date>2016-07-27T20:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875977#M532903</link>
      <description>&lt;P&gt;In your client script, the call back function should be this&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;function validateReqNo(response) {&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;var answer=response.responseXML.documentElement.getAttribute("answer");&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;alert(answer);&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="js-outcome-helpful-counts-container j-outcome-helpful-counts-container font-color-okay" data-display-overall="true" data-helpful-count="0" data-object-id="972534" data-object-type="2" data-overall-count="0" style="margin: 1em 0; font-weight: bold; font-style: inherit; font-size: 13px; font-family: inherit; color: #d1222b;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 20:02:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875977#M532903</guid>
      <dc:creator>Abhinay Erra</dc:creator>
      <dc:date>2016-07-27T20:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875978#M532904</link>
      <description>&lt;P&gt;Hi i have included client callable in my script include&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var EUTSCatalogRITMValidation = Class.create();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;EUTSCatalogRITMValidation.prototype = Object.extendsObject(AbstractAjaxProcessor, {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; validateRequestNumber: function(){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var answer=false;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var reqNo = this.getParameter('sysparm_req_number');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var reqDetails = new GlideRecord('sc_req_item');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; reqDetails.addQuery('number',reqNo);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; reqDetails.query();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; //create and return the array of environments&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; while(reqDetails.next()){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; return reqDetails.cat_item.name;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; return answer;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; },&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; type: 'EUTSCatalogRITMValidation'&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;});&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 20:06:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875978#M532904</guid>
      <dc:creator>kailashthiyagar</dc:creator>
      <dc:date>2016-07-27T20:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875979#M532905</link>
      <description>&lt;P&gt;Here is your updated script include. Also as mentioned earlier, change the call back function in your client script as well.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var EUTSCatalogRITMValidation = Class.create();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;EUTSCatalogRITMValidation.prototype = Object.extendsObject(AbstractAjaxProcessor, {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; validateRequestNumber: function(){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var answer=[];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var reqNo = this.getParameter('sysparm_req_number');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var reqDetails = new GlideRecord('sc_req_item');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; reqDetails.addQuery('number',reqNo);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; reqDetails.query();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; //create and return the array of environments&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; while(reqDetails.next()){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; answer.push(reqDetails.cat_item.name);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; return answer.toString();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; },&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; type: 'EUTSCatalogRITMValidation'&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;});&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 20:10:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875979#M532905</guid>
      <dc:creator>Abhinay Erra</dc:creator>
      <dc:date>2016-07-27T20:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875980#M532906</link>
      <description>&lt;P&gt;Hi Abhinay.. We can do either way also... but as an FYI, i have tried your apprpoach but it give undefined only&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 20:11:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875980#M532906</guid>
      <dc:creator>kailashthiyagar</dc:creator>
      <dc:date>2016-07-27T20:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Querying Related Tables sc_req_item and sc_cat_item</title>
      <link>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875981#M532907</link>
      <description>&lt;P&gt;use the updated script include form my previous comment&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jul 2016 20:12:42 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/querying-related-tables-sc-req-item-and-sc-cat-item/m-p/1875981#M532907</guid>
      <dc:creator>Abhinay Erra</dc:creator>
      <dc:date>2016-07-27T20:12:42Z</dc:date>
    </item>
  </channel>
</rss>

