rneuber1 - Friday, November 19, 2010 5:49 AM:
The following AML returns two items when used from within nash, but fails when I use
var queryTotal = innovator.newItem();
queryTotal.loadAML(ms);
var result = queryTotal.apply();
I get a "not a single item" error from "apply", because "loadAML" fails. Obviously it strips the <AML> tags and the result is a non-well-formed XML (contains more than one root element).
Is there a way to make this work?
<AML>
<Item type="Item_A"> <id>343753u33343753u33343753u33343753u33</id> </item>
<Item type="Item_B"> <id>832343753u33343753u33753u33343758977</id> </item>
</AML>
Ralf
Brian - Friday, November 19, 2010 11:13 PM:
Hi Ralf,
The AML that you load in the javascript query should not contain the <AML> tags in the first place.
I'm a bit surprised that you find the AML above works in NASH. I tried an identical arrangement and find that unless I include the action="get" I get an error.
Anyway since you are trying to return two completely unrelated ItemTypes in the query the query.apply() method will fail.
If they are related in some way then you need to include the relationships so that the return AML can be structured correctly.
I suggest you run two queries one for each item type and put the results together yourself if you need to or deal with each one independently.
Cheers,
Brian.