PLM之家PLMHome-工业软件与AI结合践行者

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

[复制链接]

2018-8-1 13:42:43 1783 0

admin 发表于 2018-8-1 13:42:43 |阅读模式

admin 楼主

2018-8-1 13:42:43

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

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

x
Technique  ( Q% m! c7 K* }) Q. O) U
Create an Item Object but use the  Item.loadAML()  method to populate the Item.
' G- C( v6 j* v1 `, K# s, |; ?1 B3 x" n! q) H0 M5 [* d
! Q* s( B; |' i* U  `; r' G
JavaScript
) i/ K5 c* ?0 }' A; r& w  v7 ]  ovar innovator = new Innovator();
! S( H9 f+ Y& i/ e+ Mvar qryItem = innovator.newItem();
. k* N0 Q2 o6 t. C2 _( AqryItem.loadAML(
  y  \8 G' a, g5 R  "<Item type='Part' action='get' select='item_number,description,cost'>" + 7 P8 \) ?* C; G1 j) [8 }
    "<item_number condition='like'>1%</item_number>" +
& O5 E8 H8 K: b. ?( n, s) I  f+ B    "<Relationships>" +
! H; _: L9 j- n6 C* d2 L      "<Item type='Part BOM' action='get' select='quantity'>" + ( R- ~1 G( R! v: J$ x/ ~/ ^3 t5 H9 o+ ]3 z
        "<quantity condition='gt'>1</quantity>" +
1 f/ e5 A. }  e* }$ ~, g, U: a      "</Item>" +
* M) D' N; V  i8 K    "</Relationships>" + 4 ^3 l! }. I1 N/ u
  "</Item>"
& M& g/ |/ r  k5 L) r% g' K8 N! }); 6 q, v# L9 M* v5 w2 C! I9 F" R% H

* P. P' G: U% y1 ]0 X6 H; y0 cvar resultItem = qryItem.apply(); - _; s! Q3 J$ h* e: i
if (resultItem.isError()) {
7 [/ R' G' p4 Y7 _& D# l  top.aras.AlertError("Item not found: " + resultItem.getErrorDetail());
# A, w9 z, x" F) s- @  return; 1 D; T1 Z* b" M% B+ T* u
} * B/ ^( q9 g& z* t& B% D& l

* S) @; K  y8 D  w3 I% f8 Vvar count = resultItem.getItemCount();
+ v" w0 T2 S, {# {  N% s3 K0 sfor (i=0; i<count; ++i) {
/ U9 g! G, S& y( j1 d: b  var item = resultItem.getItemByIndex(i); 7 T! x8 Y3 R; g# l. l& J( c
}   
) E: z. ~3 n( g: O$ w0 H# U7 f: |. ]: O! t- f% Y" j
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了