admin 发表于 2018-8-1 13:42:43

【Aras二次开发】通过AML进行Item对象查询

Technique
Create an Item Object but use theItem.loadAML()method to populate the Item.


JavaScript
var innovator = new Innovator();
var qryItem = innovator.newItem();
qryItem.loadAML(
"<Item type='Part' action='get' select='item_number,description,cost'>" +
    "<item_number condition='like'>1%</item_number>" +
    "<Relationships>" +
      "<Item type='Part BOM' action='get' select='quantity'>" +
      "<quantity condition='gt'>1</quantity>" +
      "</Item>" +
    "</Relationships>" +
"</Item>"
);

var resultItem = qryItem.apply();
if (resultItem.isError()) {
top.aras.AlertError("Item not found: " + resultItem.getErrorDetail());
return;
}

var count = resultItem.getItemCount();
for (i=0; i<count; ++i) {
var item = resultItem.getItemByIndex(i);
}   

页: [1]
查看完整版本: 【Aras二次开发】通过AML进行Item对象查询