|
|
请使用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
|
|