查看: 1842|回复: 0

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

[复制链接]

4

主题

3

回帖

40

积分

管理员

积分
40
发表于 2018-8-1 13:42:43 | 显示全部楼层 |阅读模式

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

×
Technique  
1 O! Q, e9 w/ l1 O  M& BCreate an Item Object but use the  Item.loadAML()  method to populate the Item. 3 R5 q6 D0 ]* Q
1 o/ @0 K2 }6 p

9 K! [  H% L5 XJavaScript
5 I( a7 Y6 ~- e6 [0 m- X3 X. ~* Evar innovator = new Innovator(); / O# B0 O" \" X7 z
var qryItem = innovator.newItem(); ( C0 S. [6 K! w* t% I3 Z) U% y
qryItem.loadAML( + B, x# Z9 j" X
  "<Item type='Part' action='get' select='item_number,description,cost'>" + ! a" G4 \3 ?  @) u5 [3 C
    "<item_number condition='like'>1%</item_number>" + % a% A2 h0 a% c  ?
    "<Relationships>" + ) X  ]- J( b  d( Y
      "<Item type='Part BOM' action='get' select='quantity'>" +
9 V/ I1 `- t. B  z        "<quantity condition='gt'>1</quantity>" +
$ A) U. a+ t9 O4 w) f1 E      "</Item>" +
- Q7 N9 {3 z8 z( \  `9 T! [    "</Relationships>" +
, K% ]. C: P2 N% X. O  "</Item>"
7 {1 g4 Z3 B. ?& l);
4 i+ ^! h2 B5 u0 k/ G# b! C
: @6 A, [( o6 {var resultItem = qryItem.apply();
4 W" g9 Q2 c5 _" pif (resultItem.isError()) { 6 P5 q% T8 B5 _  ^  V
  top.aras.AlertError("Item not found: " + resultItem.getErrorDetail()); / Y* K; \: H' c( J
  return; * x" \- w) r/ P) B5 j; u  v4 M8 m
}
5 F: u6 b/ s8 s; a # B; J2 p$ k: \! \3 @9 ]" H* E
var count = resultItem.getItemCount();
) W3 j8 ]+ [4 Z0 y  q, Dfor (i=0; i<count; ++i) { 7 u% R/ q& t6 @$ B+ n# `# W
  var item = resultItem.getItemByIndex(i); ' q, ?( {4 k# o; F- w  j  I
}   7 V: o6 T! o$ O) d1 P- ]
; _( T: z% E$ Z8 O, P) a
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

在本版发帖
关注公众号
QQ客服返回顶部