This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SUPPORT Q&A - Client-side method select from SQL table

Lukjan - Thursday, September 1, 2016 2:11 AM:

Hello, 

I'm new at aras and I'm trying to display in a report values from SQL table. How am I supposed to do that?

Now what I do:

 

var qryItem = innovator.newItem();

qryItem.loadAML(

"<Item type='incoming' action='get' select='*'>" +

"</Item>"

);

var resultItem = qryItem.apply();

if (resultItem.isError()) {

top.aras.AlertError("Item not found: " + resultItem.getErrorDetail());

return;

}

var count = resultItem.getItemCount();

alert(count); //got two less than in my SQL table

 

var content = "<table border='1'>" +

"<tr>" +

"<td>TEST</td>" +

"</tr>";

alert(count);

for (var i=0; i<count; ++i)

{

// Get a handle to the relationship Item by index.

// Get a handle to the related Item for this relationship Item.

content += "<tr>" +

"<td>" + resultItem[i]+ "</td>" + "</tr>"; //just to test what I get here, got undefined

}

return content + "</table>";

EDIT;

 

tried this too, but got the same result:

 

var qryItem = innovator.newItem("incoming","get");

var qryItem = this.newItem("incoming","get");

qryItem.setAttribute("select","*");

var resultItem = qryItem.apply();



edonahue - Monday, September 12, 2016 11:01 AM:

Hi Lukjan,

Is your "incoming" ItemType versionable? If you have items that are not current (is_current='1'), then they will not be returned in your AML query. That could explain why you are seeing two more items in your database than in your query results.