|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
1 M, _6 c8 r" j$ aCreate an Item Object but use the Item.loadAML() method to populate the Item.
) ?' t) |) K; Q @2 e" x. x% f* F7 m0 R
$ A! O: d$ F4 C* f" G @8 E2 N0 w- H: J9 n, G' k
JavaScript 8 l/ u0 H7 F4 Q; D6 t6 p
var innovator = new Innovator();
8 T. Q/ C5 O1 [var qryItem = innovator.newItem(); 9 ]* {% \; |! h' x: B
qryItem.loadAML( 2 ?3 V* p4 d- W) ^# L3 i
"<Item type='Part' action='get' select='item_number,description,cost'>" +
; I a1 H" h3 p5 l, [. H: ] "<item_number condition='like'>1%</item_number>" + 3 O+ z8 ?( F* H6 o, D6 O
"<Relationships>" + ! S- C5 t5 a" R6 `% i' {6 } e) u
"<Item type='Part BOM' action='get' select='quantity'>" +
z5 x6 i9 ~' y+ _6 W* _ "<quantity condition='gt'>1</quantity>" + + ^0 \+ ~( x2 [, Z
"</Item>" + 9 q# j0 A/ p2 t- f& _$ d" w6 A
"</Relationships>" + " \2 B: _' J3 ^9 I8 ^8 X
"</Item>" 4 K9 W$ j( N, ]! N8 A6 v
);
p( H+ C/ K% c; N
# j& W7 w; n6 d3 m" h' {( uvar resultItem = qryItem.apply();
3 I7 O8 b+ K2 C* y. ?6 W( g# }1 M% Wif (resultItem.isError()) {
( a. z6 d8 b, M- X% K# h0 d! j% Y3 E top.aras.AlertError("Item not found: " + resultItem.getErrorDetail()); + Z, p6 i! D) f6 E
return; 8 e( G2 u O- ^
} $ \* w) i6 [" M
% v0 p9 `4 S3 T# g, @
var count = resultItem.getItemCount(); 7 n) J- z6 q/ z
for (i=0; i<count; ++i) {
9 D3 n) Q# h6 ^0 O- k var item = resultItem.getItemByIndex(i);
6 {8 H8 x- V& W8 D4 L5 a}
( e7 Q1 s, h; Y3 c8 |
/ m7 x z' ]0 T" q |
|