Calling server method from another server method

Hello All,

From one server method (Method A ), I'm calling another server method (Method B) .

From (Method B) returning inn.newError("Error"); 

And in calling method (Method A) checking result has error but it is not working. Error message is showing directly on UI.

Item X = inn.applyMethod("Method_B","");

if(X.isError())

{

//execute xlogic

else

{

  //execute y logic

}

But if case is not executing & error message directly displaying on UI.

Regards,

Suhas

Parents Reply
  • Hi Suhas,

    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:

    // we have an Innovator object called inn
    var methodItem = inn.newItem("Method");
    methodItem.setProperty("some_info_for_method_b", "value for that info");
    var resultItem = methodItem.apply("Method B");

    You can then access some_info_for_method_b in Method B with

    string info = this.getProperty("some_info_for_method_b", "")

    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.

    Hope this helps,

    C

Children