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
  • Hi there,

    you can also just use any method as the apply()-action on any item. Consequently, that item would be "this" in the called method.

    I.e.

    var methodResult = someItem.apply("Method B");

    Hope this helps,

    C

    EDIT: Just to clear up the confusion with applyMethod(): The second input parameter to applyMethod() is supposed to be a string representation of the dom of the Item you want to be "this" in the method. Hence your approach results in an error, you passed an empty method item.
    From the API description:

    Parameters
      methodName
       Name of the method.
      body
       Context for the method (method item).
    Remarks
    The context for the method will be the method item, in the form: <Item type="Method" action="{methodName}">{body}</Item> Note, that only methods that use IOM namespace from .NET (C#, VBScript) can be applied, and methods written in JavaScript cannot be applied.
Reply
  • Hi there,

    you can also just use any method as the apply()-action on any item. Consequently, that item would be "this" in the called method.

    I.e.

    var methodResult = someItem.apply("Method B");

    Hope this helps,

    C

    EDIT: Just to clear up the confusion with applyMethod(): The second input parameter to applyMethod() is supposed to be a string representation of the dom of the Item you want to be "this" in the method. Hence your approach results in an error, you passed an empty method item.
    From the API description:

    Parameters
      methodName
       Name of the method.
      body
       Context for the method (method item).
    Remarks
    The context for the method will be the method item, in the form: <Item type="Method" action="{methodName}">{body}</Item> Note, that only methods that use IOM namespace from .NET (C#, VBScript) can be applied, and methods written in JavaScript cannot be applied.
Children
No Data