Jun 15, 2017, 10:48 AM
[CLOSED] direct method returns undefined value
Hello,
I have a direct method which gets 2 arguments and returns a value (string). While I can see that the direct method is called and the return value "result" is as expected (the alert function prints it with the correct value), the value in the HTML is 'undefined'
I have a direct method which gets 2 arguments and returns a value (string). While I can see that the direct method is called and the return value "result" is as expected (the alert function prints it with the correct value), the value in the HTML is 'undefined'
Handler="
this.body.dom.innerHTML = String.format('{0}',(#{QueriesStore1}.getAt(rowIndex).get('PtId') !=null? #{DirectMethods}.callFNGetPtidPrfx(#{QueriesStore1}.getAt(rowIndex).get('SiteId'),#{QueriesStore1}.getAt(rowIndex).get('PtId'),{
success: function (result) {
alert(result);
return result;
}
}):'-')
The direct method:[DirectMethod]
public string callFNGetPtidPrfx(int siteid, int ptid)
{
DAL.CDataContext dc = new CDataContext(); //the arguments have the correct value here
return dc.fn_GetPtid(100, siteid, ptid);
}
Last edited by fabricio.murta; Aug 18, 2017 at 10:13 PM.