<?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>Calling server method from another server method</title><link>https://www.aras.com/community/f/development/9206/calling-server-method-from-another-server-method</link><description>Hello All, 
 
 From one server method (Method A ), I&amp;#39;m calling another server method (Method B) . 
 From (Method B) returning inn.newError(&amp;quot;Error&amp;quot;); 
 And in calling method (Method A) checking result has error but it is not working. Error message is showing</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Calling server method from another server method</title><link>https://www.aras.com/community/thread/4550?ContentTypeID=1</link><pubDate>Wed, 11 Mar 2020 07:17:33 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:672ef232-d119-40f8-a4f2-fd08629dd50b</guid><dc:creator>Suhas</dc:creator><description>&lt;p&gt;Hello Cogres,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the update. It is working fine.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Suhas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling server method from another server method</title><link>https://www.aras.com/community/thread/4545?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 07:56:37 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:4ce0fb2e-f67d-46c7-88c1-028cc2b03573</guid><dc:creator>cogres</dc:creator><description>&lt;p&gt;Hi Suhas,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;see my reply below. You can pass any information from Method A to Method B by setting properties on the item you apply the method on:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
    // we have an Innovator object called inn &lt;br /&gt;
    var methodItem = inn.newItem(&amp;quot;Method&amp;quot;);&lt;br /&gt;
    methodItem.setProperty(&amp;quot;some_info_for_method_b&amp;quot;, &amp;quot;value for that info&amp;quot;);&lt;br /&gt;
    var resultItem = methodItem.apply(&amp;quot;Method B&amp;quot;);&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You can then access some_info_for_method_b in Method B with&lt;/p&gt;
&lt;p&gt;&lt;code&gt;string info = this.getProperty(&amp;quot;some_info_for_method_b&amp;quot;, &amp;quot;&amp;quot;)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Of course, you can set as many of those auxiliary properties as you like, or pass all method arguments in one property, separated by commas.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling server method from another server method</title><link>https://www.aras.com/community/thread/4544?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 07:52:43 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:098e4c9d-4a03-40bb-9ecb-744f4007fdd0</guid><dc:creator>Suhas</dc:creator><description>&lt;p&gt;Hello Kate,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How to pass parameter(argument) to Method_B? with the help of setProperty()?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Suhas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling server method from another server method</title><link>https://www.aras.com/community/thread/4543?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 07:46:40 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:0dbe1d56-8cb4-4389-b635-3bbbfd4e15c2</guid><dc:creator>cogres</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;you can also just use any method as the apply()-action on any item. Consequently, that item would be &amp;quot;this&amp;quot; in the called method.&lt;/p&gt;
&lt;p&gt;I.e.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;var methodResult = someItem.apply(&amp;quot;Method B&amp;quot;);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;p&gt;EDIT: Just to clear up the confusion with applyMethod(): The second input parameter to applyMethod() is supposed to be a string representation of the dom of the Item you want to be &amp;quot;this&amp;quot; in the method. Hence your approach results in an error, you passed an empty method item.&lt;br /&gt;From the API description:&lt;/p&gt;
&lt;table class="helpTable" width="100%"&gt;
&lt;tbody&gt;
&lt;tr style="display:block;" id="parameters_slot"&gt;
&lt;td&gt;&lt;b&gt;Parameters&lt;/b&gt;
&lt;div class="text_class" id="help_parameters"&gt;&amp;nbsp;&amp;nbsp;&lt;i&gt;methodName&lt;/i&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name of the method.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;i&gt;body&lt;/i&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Context for the method (method item).&lt;/div&gt;
&lt;table height="100%" width="100%"&gt;
&lt;tbody&gt;
&lt;tr class="text_class"&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="display:block;" id="remarks_slot"&gt;
&lt;td&gt;&lt;b&gt;Remarks&lt;/b&gt;
&lt;div class="text_class" id="help_remarks"&gt;The context for the method will be the method item, in the form: &amp;lt;Item type=&amp;quot;Method&amp;quot; action=&amp;quot;{methodName}&amp;quot;&amp;gt;{body}&amp;lt;/Item&amp;gt; Note, that only methods that use IOM namespace from .NET (C#, VBScript) can be applied, and methods written in JavaScript cannot be applied.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling server method from another server method</title><link>https://www.aras.com/community/thread/4541?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 17:26:00 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:f24a52b8-9df2-4e08-901e-3825f5e29a27</guid><dc:creator>Kate Marsh</dc:creator><description>&lt;p&gt;Hi Suhas,&lt;/p&gt;
&lt;p&gt;The applyMethod function will cause a client-side error dialog to show up.&amp;nbsp; You&amp;#39;ll want to use the inn.apply() function instead.&lt;/p&gt;
&lt;p&gt;Try replacing the line &amp;quot;Item X = etc.&amp;quot; from Method A with&lt;/p&gt;
&lt;p&gt;Item X = inn.newItem(&amp;quot;Method&amp;quot;, &amp;quot;Method_B&amp;quot;);&lt;br /&gt;X = X.apply();&lt;/p&gt;
&lt;p&gt;This should make everything else work as is.&lt;/p&gt;
&lt;p&gt;-Kate&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>