<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Get property js</title><link>https://www.aras.com/community/f/development/3772/get-property-js</link><description>Hi

i want to get value of field , the code is

var innovator = new Innovator();

var partItem = innovator.newItem(“t4result”,”get”);

var a =partItem.getproperty(“t4id”);

console.log(a);

——————-

the result is undefined, what is the problem ?</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Get property js</title><link>https://www.aras.com/community/thread/1763?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 09:27:22 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:2333512e-6594-4e6a-a0d3-313db79167cd</guid><dc:creator>Christopher Gillis</dc:creator><description>Hello,

Using &lt;code&gt;innovator.newItem&lt;/code&gt; will create a new query-able item, but will not return any data by itself. The AML created behind the scenes for the line &lt;code&gt;var partItem = innovator.newItem(&amp;quot;t4result&amp;quot;,&amp;quot;get&amp;quot;);&lt;/code&gt; looks like the query below.

&lt;pre&gt;&lt;code&gt;&amp;lt;AML&amp;gt;
&amp;lt;Item type=&amp;quot;t4result&amp;quot; action=&amp;quot;get&amp;quot;/&amp;gt;
&amp;lt;/AML&amp;gt;&lt;/code&gt;&lt;/pre&gt;


In order to run this query and get data, you would need to use &lt;code&gt;partItem.apply();&lt;/code&gt;; however, without passing in any additional parameters, this query will get all of the t4result items instead of just the one you are editing.

Additionally, running an item query like this will get the current state of the item from the server, but will not contain any field data unless you have already saved the item.

In order to get the value entered in a field, you can use the sample code below.

&lt;code&gt;var val = getFieldByName(&amp;quot;t4id&amp;quot;).getElementsByTagName(&amp;quot;input&amp;quot;)[0].value;&lt;/code&gt;

Chris

&lt;hr /&gt;

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>