Quantcast
Channel: aras PLM community
Viewing all articles
Browse latest Browse all 1103

Problem calling server side method from client

$
0
0

Hi,
I've created my own .html file on the server, that I use for showing a dialog (using below code):

Client method calling my custom .html:
var result = top.aras.modalDialogHelper.show("DefaultModal", win, params2, { dialogWidth: 325, dialogHeight: 400, center: true}, "../Solutions/test.html");

In the test.html I use top.aras.applyMethod() to call a server side method:

Custom .html file:
var result = top.aras.applyMethod("myMethod", this);
aras.AlertError(typeof result);    // --> Shows returned type is string

My problem is that the variable result is now of type "string", not "Item", even though my server side method returns an item:

Server side method:
string AML = "<AML><Item type='Part' action='get'></Item></AML>";
Item parts = inn.applyAML(AML);
return parts;

Because "result" is not an Item, I can't use any of the methods like .getItemByIndex() or .getItemCount().

I have also verified that I have the same issue when trying to run AML directly from my .html file:

var aml = "<AML><Item type='Part' action='get'></Item></AML>";
var result = top.aras.applyAML(aml);

Am I missing something, or is there a way to convert string to Item? (the string looks like items, so when I just print the variable it looks like I've got an Item)


Viewing all articles
Browse latest Browse all 1103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>