<?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>Function is undefined</title><link>https://www.aras.com/community/f/development/3480/function-is-undefined</link><description>Hello all

I have a form and I wanted to add a button to this form, I have a server side method and I choose this method as a button Click or button Focus event.

I get the following error

Event handler failed with message: &amp;#39;func$FE48E619C551415A8C3F9D0023594694</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Function is undefined</title><link>https://www.aras.com/community/thread/1067?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2017 03:56:28 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:ee9dee0a-523d-4675-8aa2-54fef9830f93</guid><dc:creator>Former Member</dc:creator><description>thanks  :)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function is undefined</title><link>https://www.aras.com/community/thread/1063?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2017 09:25:25 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:c8ea4311-3e1a-4578-9ec2-f5f5f7835208</guid><dc:creator>Christopher Gillis</dc:creator><description>Hello,

You can use that exact line of code to get the return value from a server method. Just note that the return value will be placed inside of a &amp;lt;Result/&amp;gt; tag like below.

&lt;code&gt;&amp;lt;Result&amp;gt;YOUR RETURN VALUE&amp;lt;/Result&amp;gt;&lt;/code&gt;

Chris

_______________________________________

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function is undefined</title><link>https://www.aras.com/community/thread/1058?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2017 05:50:01 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:daa80343-0604-404b-af21-38b442c2764e</guid><dc:creator>Former Member</dc:creator><description>Thank you for you response.

Is there anyway that I can also have the function on the server side and get the return value on the client side?

something like
&lt;blockquote&gt;var retValue = aras.applyMethod(&amp;quot;My Method&amp;quot;, &amp;#39;&amp;#39;);

&amp;nbsp;&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function is undefined</title><link>https://www.aras.com/community/thread/1051?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 10:30:20 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:a7e61a45-fc49-488e-86a7-a9ef0f74e53b</guid><dc:creator>Christopher Gillis</dc:creator><description>Hello,

It is not possible to use a server-side method with Form Events or Field Events. However, you can call a server-side method from within a JavaScript method using code like the sample below.

&lt;code&gt;aras.applyMethod(&amp;quot;My Method&amp;quot;, &amp;#039;&amp;#039;);&lt;/code&gt;

The second argument can be used to pass in any arguments to the server-side method that you need.

&lt;code&gt;aras.applyMethod(&amp;quot;My Method&amp;quot;, &amp;quot;&amp;lt;myArg&amp;gt;My Arg&amp;#039;s Value&amp;lt;/myArg&amp;gt;&amp;quot;);&lt;/code&gt;

You can then retrieve these arguments from within your server-side method with a line like below.

&lt;code&gt;this.getProperty(&amp;quot;myArg&amp;quot;);&lt;/code&gt;

Chris

_____________________________________________

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function is undefined</title><link>https://www.aras.com/community/thread/1047?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 07:11:57 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:2e77ace6-27cf-40f8-a0b2-d47a8fe551c7</guid><dc:creator>Former Member</dc:creator><description>can I use c# on the serverside for button clicks on forms? or should be always the JavaScript?

&amp;nbsp;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>