Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
8 years ago

Function is undefined

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: 'func$FE48E619C551415A8C3F9D0023594694$_onfocus0' is undefined   Am I missing some steps? Thanks

5 Replies

  • 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. aras.applyMethod("My Method", ''); The second argument can be used to pass in any arguments to the server-side method that you need. aras.applyMethod("My Method", "<myArg>My Arg's Value</myArg>"); You can then retrieve these arguments from within your server-side method with a line like below. this.getProperty("myArg"); Chris _____________________________________________ Christopher Gillis Aras Labs Software Engineer
  • can I use c# on the serverside for button clicks on forms? or should be always the JavaScript?  
  • 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
    var retValue = aras.applyMethod("My Method", '');  
  • 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 <Result/> tag like below. <Result>YOUR RETURN VALUE</Result> Chris _______________________________________ Christopher Gillis Aras Labs Software Engineer