<?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>How to call a client method from another client method?</title><link>https://www.aras.com/community/f/development/36367/how-to-call-a-client-method-from-another-client-method</link><description>Hello everybody. 
 I have several client methods which are sharing some common code. I would like to put that code in a method, and call that method from the other methods, everything is client side. How can I do that?</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to call a client method from another client method?</title><link>https://www.aras.com/community/thread/6505?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 07:11:50 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:5465acb8-c16d-435e-b9e9-605842f70057</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;Hi Antoined,&lt;/p&gt;
&lt;p&gt;I assume you have been fooled by a spam bot.&lt;/p&gt;
&lt;p&gt;Check out my super handy blog article where I give an overview of the various Method calls:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://plm-underground.com/method-calls"&gt;https://plm-underground.com/method-calls&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;JS sample is at the bottom. I also plan a video regarding Method calls on my &lt;a href="https://www.youtube.com/channel/UCLqtWrKtuEzTb5ntjObkOLA"&gt;Youtube&lt;/a&gt;&amp;nbsp;channel this week. &lt;span class="emoticon" data-url="https://www.aras.com/community/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to call a client method from another client method?</title><link>https://www.aras.com/community/thread/6501?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 14:14:07 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:f1b32ca3-c7c6-4fdf-8c63-f1533c778099</guid><dc:creator>antoined</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure what you are talking about. I don&amp;#39;t have a server part of the method.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to call a client method from another client method?</title><link>https://www.aras.com/community/thread/6493?ContentTypeID=1</link><pubDate>Thu, 01 Apr 2021 11:38:10 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:88cb35ba-f806-4bda-bc2a-45253227484f</guid><dc:creator>Shannon854</dc:creator><description>&lt;div class="s-prose js-post-body" itemprop="text"&gt;
&lt;p&gt;You can wrap the server part of a shared method with&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;this.isSimulation&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;When you run a shared method it first runs a simulation on the client and then on server - updating the client with its results (which are usually the same - which is why it&amp;#39;s called Optimistic UI).&lt;/p&gt;
&lt;/div&gt;
&lt;div class="mt24"&gt;
&lt;div class="grid fw-wrap ai-start jc-end gs8 gsy"&gt;&lt;time itemprop="dateCreated" datetime="2016-03-10T01:30:31"&gt;&lt;/time&gt;
&lt;div class="grid--cell mr16"&gt;
&lt;div class="js-post-menu pt2"&gt;
&lt;div class="grid d-flex gs8 s-anchors s-anchors__muted fw-wrap"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to call a client method from another client method?</title><link>https://www.aras.com/community/thread/6492?ContentTypeID=1</link><pubDate>Wed, 31 Mar 2021 14:02:14 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:bad3d07c-dd04-4af9-b66c-6aca1fc9f130</guid><dc:creator>antoined</dc:creator><description>&lt;p&gt;So, I finally found this:&lt;/p&gt;
&lt;pre&gt;/**&lt;br /&gt;&amp;nbsp;* Method to evaluate JavaScript stored as a Method item on the client side.&lt;br /&gt;&amp;nbsp;* @param {string} methodName the name of the Method item&lt;br /&gt;&amp;nbsp;* @param {Object} itemDom the item dom&lt;br /&gt;&amp;nbsp;* @param {Object} [addArgs] Object with any additional parameters.&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;Aras.prototype.evalItemMethod = function Aras_evalItemMethod(methodName, itemDom, addArgs)&lt;/pre&gt;
&lt;p&gt;And indeed I am able to call a method when giving it the good methodName. Then, from the other methods, I can access the addArgs array with &lt;span style="font-family:courier new, courier;"&gt;arguments[1]&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>