Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
7 years ago

inn.applyMethod() doesnot work at all :(:(:(

I am trying to call server method(C#) from client method(Javascript) but applyMethod() doesnot work at all......... :(

var ctx = this.document.thisItem;

var inn = ctx.getInnovator();

var branches = inn.applyMethod("SFT_LoadBranchesServer","<source_id>"+document.thisItem.getID()+"</source_id>"

4 Replies

  • Hi Mrunal

    Could you please provide what error are you getting ?. I'm able to run the server method using below. Are you getting getID() value in your code?

    var inn = document.thisItem.getInnovator();

    var itemid = document.item.getAttribute("id");

    var body = "<itemId>" + itemid + "</itemId>";

    var voteRes = inn.applyMethod("ServerMethodName", body);

    • Former_Member's avatar
      Former_Member
      Accelerator III

      thank you for reply, 

      I am actually not getting any error, is there any way to debug or see logs generated by server methods ? I cants see anything happening when I call my server method. 

      • asebastian's avatar
        asebastian
        Community Manager

        Hi Mrunal,

        This blog post covers how to Debug a server method. It's possible there is an error within the server code which would cause it to exit prematurely. Making sure the server code is being run and stepping through it should help you solve your issue.