<?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: What's the opposite of INSTANCEOF? in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/what-s-the-opposite-of-instanceof/m-p/3196518#M1184475</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RafaRataj_1-1741169269741.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424186iB47FE92186DFA4E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RafaRataj_1-1741169269741.png" alt="RafaRataj_1-1741169269741.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;you can use the class path&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; childClass = gr.child.sys_class_path.toString();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (childClass.startsWith(&lt;/SPAN&gt;&lt;SPAN&gt;"/!!/!2/!(/!!"&lt;/SPAN&gt;&lt;SPAN&gt;)){ &lt;/SPAN&gt;&lt;SPAN&gt;// is Instance of server &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; children.push(childSysId);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RafaRataj_0-1741169239644.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424185iC7C7318D3F03A7B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RafaRataj_0-1741169239644.png" alt="RafaRataj_0-1741169239644.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Mar 2025 10:12:57 GMT</pubDate>
    <dc:creator>Rafał Rataj</dc:creator>
    <dc:date>2025-03-05T10:12:57Z</dc:date>
    <item>
      <title>What's the opposite of INSTANCEOF?</title>
      <link>https://www.servicenow.com/community/developer-forum/what-s-the-opposite-of-instanceof/m-p/1709673#M366599</link>
      <description>&lt;P&gt;I have a given class name, such as 'cmdb_ci_linux_server'. &amp;nbsp; Now I want to find all the cmdb_model entries that would be a valid choice for an asset of type cmdb_ci_linux_server, so I started off like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14453780125619783" jivemacro_uid="_14453780125619783"&gt;
&lt;P&gt;var gr = new GlideRecord('cmdb_model');&lt;/P&gt;
&lt;P&gt;gr.addQuery('status', '!=', 'Retired');&lt;/P&gt;
&lt;P&gt;gr.addNotNullQuery('name');&lt;/P&gt;
&lt;P&gt;gr.addQuery('cmdb_ci_class', 'INSTANCEOF', 'cmdb_ci_linux_server');&lt;/P&gt;
&lt;P&gt;gr.query();&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that INSTANCEOF is backwards. &amp;nbsp; Is there a way to flip that around? &amp;nbsp; So basically I want to return all models where the cmdb_ci_class belongs to a table that cmdb_ci_linux_server inherits from. &amp;nbsp; I want a PARENTOF type qualifier &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://www.servicenow.com/6.0.3.0/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an easy way to do that, or do I just have to use TableUtils() and manually build up a big or statement?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 21:55:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/what-s-the-opposite-of-instanceof/m-p/1709673#M366599</guid>
      <dc:creator>grosch</dc:creator>
      <dc:date>2015-10-20T21:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: What's the opposite of INSTANCEOF?</title>
      <link>https://www.servicenow.com/community/developer-forum/what-s-the-opposite-of-instanceof/m-p/1709674#M366600</link>
      <description>&lt;P&gt;Unless there is a undocumented operator that someone is privy to, you'll have to use TableUtils()&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Oct 2015 02:10:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/what-s-the-opposite-of-instanceof/m-p/1709674#M366600</guid>
      <dc:creator>paulmorris</dc:creator>
      <dc:date>2015-10-21T02:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: What's the opposite of INSTANCEOF?</title>
      <link>https://www.servicenow.com/community/developer-forum/what-s-the-opposite-of-instanceof/m-p/2366908#M926295</link>
      <description>&lt;P&gt;I would do it this way&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var gr = new GlideRecord('cmdb_model');
gr.addQuery('status', '!=', 'Retired');
gr.addNotNullQuery('name');
gr.addQuery('cmdb_ci_class', 'IN', j2js(GlideDBObjectManager.get().getTables('cmdb_ci_linux_server')));
gr.query();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Oct 2022 23:39:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/what-s-the-opposite-of-instanceof/m-p/2366908#M926295</guid>
      <dc:creator>James Fricker</dc:creator>
      <dc:date>2022-10-30T23:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: What's the opposite of INSTANCEOF?</title>
      <link>https://www.servicenow.com/community/developer-forum/what-s-the-opposite-of-instanceof/m-p/3196518#M1184475</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RafaRataj_1-1741169269741.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424186iB47FE92186DFA4E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RafaRataj_1-1741169269741.png" alt="RafaRataj_1-1741169269741.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;you can use the class path&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; childClass = gr.child.sys_class_path.toString();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (childClass.startsWith(&lt;/SPAN&gt;&lt;SPAN&gt;"/!!/!2/!(/!!"&lt;/SPAN&gt;&lt;SPAN&gt;)){ &lt;/SPAN&gt;&lt;SPAN&gt;// is Instance of server &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; children.push(childSysId);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RafaRataj_0-1741169239644.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424185iC7C7318D3F03A7B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RafaRataj_0-1741169239644.png" alt="RafaRataj_0-1741169239644.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 10:12:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/what-s-the-opposite-of-instanceof/m-p/3196518#M1184475</guid>
      <dc:creator>Rafał Rataj</dc:creator>
      <dc:date>2025-03-05T10:12:57Z</dc:date>
    </item>
  </channel>
</rss>

