<?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 Dot walk to CI class field in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178839#M835765</link>
    <description>&lt;P&gt;I'm doing a g_form.getReference on the cmdb_ci field in a client script for incidents.&amp;nbsp; I'm trying to dot walk to a specific filed that is part of a specific class.&amp;nbsp; The filed is only on this class and when I do ci.u_service_level I get undefined.&amp;nbsp; What do I need to add to be able to get that field thought a dot walk via script?&amp;nbsp; Or am I going to have to do a GlideRecord query?&amp;nbsp; Below is my script.&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function onChange(control, oldValue, newValue, isLoading, isTemplate) {
	if (isLoading || newValue === '') {
		return;
	}
	//Type appropriate comment here, and begin script below
	g_form.getReference('cmdb_ci', function(ci){
		if (ci.sys_class_name == 'u_cmdb_ci_myclass'){
			alert(ci.u_service_level);
		}
	});
}&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 18 Feb 2019 19:05:16 GMT</pubDate>
    <dc:creator>brianlan25</dc:creator>
    <dc:date>2019-02-18T19:05:16Z</dc:date>
    <item>
      <title>Dot walk to CI class field</title>
      <link>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178839#M835765</link>
      <description>&lt;P&gt;I'm doing a g_form.getReference on the cmdb_ci field in a client script for incidents.&amp;nbsp; I'm trying to dot walk to a specific filed that is part of a specific class.&amp;nbsp; The filed is only on this class and when I do ci.u_service_level I get undefined.&amp;nbsp; What do I need to add to be able to get that field thought a dot walk via script?&amp;nbsp; Or am I going to have to do a GlideRecord query?&amp;nbsp; Below is my script.&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function onChange(control, oldValue, newValue, isLoading, isTemplate) {
	if (isLoading || newValue === '') {
		return;
	}
	//Type appropriate comment here, and begin script below
	g_form.getReference('cmdb_ci', function(ci){
		if (ci.sys_class_name == 'u_cmdb_ci_myclass'){
			alert(ci.u_service_level);
		}
	});
}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Feb 2019 19:05:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178839#M835765</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2019-02-18T19:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dot walk to CI class field</title>
      <link>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178840#M835766</link>
      <description>&lt;P&gt;Hi Brian,&lt;/P&gt;
&lt;P&gt;Dot-walking doesn't work with getReference since the client side only fetches the value that specific record has. it has no clue what values the dot-walked field has. This is one of the reasons ServiceNow doesn't recommend using it anymore. I think you will need a good old GlideAjax call here.&lt;/P&gt;
&lt;DIV&gt;//Göran&lt;/DIV&gt;
&lt;DIV&gt;Feel free to connect with me:&lt;BR /&gt;&lt;A title="Click here!" href="https://www.linkedin.com/in/goranlundqvist/" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;LinkedIn &amp;amp; &lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A title="Click here!" href="https://twitter.com/GoranLundqvist" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;Twitter&lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;Subscribe to my &lt;A title="Click here!" href="https://www.youtube.com/channel/UCUJK90r6dnu-YXHyDOVIRww?view_as=subscriber" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;YouTube Channel&lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;Buy &lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;&lt;A title="Click here!" href="https://www.amazon.com/gp/product/179462631X" target="_blank" rel="noopener noreferrer nofollow"&gt;The Witch Doctor's Guide To ServiceNow&lt;/A&gt;&amp;nbsp;&lt;/U&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Feb 2019 19:15:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178840#M835766</guid>
      <dc:creator>Goran WitchDoc</dc:creator>
      <dc:date>2019-02-18T19:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dot walk to CI class field</title>
      <link>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178841#M835767</link>
      <description>&lt;P&gt;But I can dot walk to the sys_class_name without issue otherwise my alert would never get called.&amp;nbsp; I have check other CIs that do not have that class and the alert does not appear.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 19:20:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178841#M835767</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2019-02-18T19:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dot walk to CI class field</title>
      <link>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178842#M835768</link>
      <description>&lt;P&gt;I think I read it to fast, what you do isn't "dot-walk". Since Dot-walk usually means that you go to another record. Like if I have a incident record as current I can type current.caller_id and I'm not dot-walking, but current.caller_id.email is. Since then I need to go into the caller record to get the email address. The caller_id value is on incident.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But your problem seems strange. if you use getDisplayValue, does that work?&lt;/P&gt;
&lt;DIV&gt;//Göran&lt;/DIV&gt;
&lt;DIV&gt;Feel free to connect with me:&lt;BR /&gt;&lt;A title="Click here!" href="https://www.linkedin.com/in/goranlundqvist/" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;LinkedIn &amp;amp; &lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A title="Click here!" href="https://twitter.com/GoranLundqvist" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;Twitter&lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;Subscribe to my &lt;A title="Click here!" href="https://www.youtube.com/channel/UCUJK90r6dnu-YXHyDOVIRww?view_as=subscriber" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;YouTube Channel&lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;Buy &lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;&lt;A title="Click here!" href="https://www.amazon.com/gp/product/179462631X" target="_blank" rel="noopener noreferrer nofollow"&gt;The Witch Doctor's Guide To ServiceNow&lt;/A&gt;&amp;nbsp;&lt;/U&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Feb 2019 19:28:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178842#M835768</guid>
      <dc:creator>Goran WitchDoc</dc:creator>
      <dc:date>2019-02-18T19:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dot walk to CI class field</title>
      <link>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178843#M835769</link>
      <description>&lt;P&gt;Where exactly do you want me to try getDisplayValue?&amp;nbsp; I notice when I try to search for incidents with the u_service_level = 3 I get the following in the encoded query so I'm not sure if there is special scripting I have to do for this or it will not work.&lt;/P&gt;
&lt;P&gt;cmdb_ci.ref_u_cmdb_ci_myclass.u_service_level=3&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 19:35:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178843#M835769</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2019-02-18T19:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dot walk to CI class field</title>
      <link>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178844#M835770</link>
      <description>&lt;P&gt;Ahh that is probably the reason, you are using getReference on a field that is reference to the cmdb_ci table. And the field you want to get isn't on that table, but on an extended table. That means that when you query the record from cmdb_ci, you won't get back that field, only the field that exist in the cmdb_ci table.&lt;/P&gt;
&lt;DIV&gt;//Göran&lt;/DIV&gt;
&lt;DIV&gt;Feel free to connect with me:&lt;BR /&gt;&lt;A title="Click here!" href="https://www.linkedin.com/in/goranlundqvist/" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;LinkedIn &amp;amp; &lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A title="Click here!" href="https://twitter.com/GoranLundqvist" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;Twitter&lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;Subscribe to my &lt;A title="Click here!" href="https://www.youtube.com/channel/UCUJK90r6dnu-YXHyDOVIRww?view_as=subscriber" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;YouTube Channel&lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;Buy &lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;&lt;A title="Click here!" href="https://www.amazon.com/gp/product/179462631X" target="_blank" rel="noopener noreferrer nofollow"&gt;The Witch Doctor's Guide To ServiceNow&lt;/A&gt;&amp;nbsp;&lt;/U&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Feb 2019 19:38:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178844#M835770</guid>
      <dc:creator>Goran WitchDoc</dc:creator>
      <dc:date>2019-02-18T19:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dot walk to CI class field</title>
      <link>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178845#M835771</link>
      <description>&lt;P&gt;And I&amp;nbsp; would recommend doing a GlideAjax call fore this as well to make sure you get the information you really want.&lt;/P&gt;
&lt;DIV&gt;//Göran&lt;/DIV&gt;
&lt;DIV&gt;Feel free to connect with me:&lt;BR /&gt;&lt;A title="Click here!" href="https://www.linkedin.com/in/goranlundqvist/" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;LinkedIn &amp;amp; &lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A title="Click here!" href="https://twitter.com/GoranLundqvist" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;Twitter&lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;Subscribe to my &lt;A title="Click here!" href="https://www.youtube.com/channel/UCUJK90r6dnu-YXHyDOVIRww?view_as=subscriber" target="_blank" rel="noopener noreferrer nofollow"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;YouTube Channel&lt;/U&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;Buy &lt;SPAN style="color: #0000ff;"&gt;&lt;U&gt;&lt;A title="Click here!" href="https://www.amazon.com/gp/product/179462631X" target="_blank" rel="noopener noreferrer nofollow"&gt;The Witch Doctor's Guide To ServiceNow&lt;/A&gt;&amp;nbsp;&lt;/U&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Feb 2019 19:39:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178845#M835771</guid>
      <dc:creator>Goran WitchDoc</dc:creator>
      <dc:date>2019-02-18T19:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dot walk to CI class field</title>
      <link>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178846#M835772</link>
      <description>&lt;P&gt;That is what I figured but just wanted to see if there was a way to do it.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 20:14:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/dot-walk-to-ci-class-field/m-p/2178846#M835772</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2019-02-18T20:14:43Z</dc:date>
    </item>
  </channel>
</rss>

