|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
6 m1 [5 `, X1 ]. G4 ^/ {Create an Item Object but use the Item.loadAML() method to populate the Item. 2 @ O2 P, h4 g7 s' |
2 O' |& w4 w0 z( a" F! w" `- [/ Q- T4 `7 H- ^0 j
JavaScript
- K4 S4 ?* L* z. Y Z% ?var innovator = new Innovator(); & _7 L/ R1 L3 X1 f' e( U0 B
var qryItem = innovator.newItem(); ' r5 H4 ?& m L, n" \9 Y' {' a" N% g
qryItem.loadAML(
5 Y+ f" _' R: P- q, y "<Item type='Part' action='get' select='item_number,description,cost'>" + # m; r' {! F/ r6 K* w) ]$ A. N
"<item_number condition='like'>1%</item_number>" + ( j0 o3 A0 t& l; s u, K
"<Relationships>" +
0 O8 I# Q! p: H U6 H2 t "<Item type='Part BOM' action='get' select='quantity'>" +
- A0 K$ X; _1 r& }; X" F/ t2 [& t$ a "<quantity condition='gt'>1</quantity>" +
) t! }0 C6 @/ Y# T8 a4 `. @ "</Item>" +
0 Q2 d; M6 A! P1 W "</Relationships>" +
p$ c+ h) r- E, g( U! a0 C e "</Item>" 5 A! j3 A" @$ |" w, ~( M" P
);
1 ]" U, q8 e8 I7 O! B2 Z3 p 6 z8 N3 O1 ?7 I, y! n( S7 k" w; h3 W
var resultItem = qryItem.apply();
' H. z; a, x# [* b* g: ~if (resultItem.isError()) { 0 ?* J5 }' k7 N0 c. F
top.aras.AlertError("Item not found: " + resultItem.getErrorDetail()); 7 {; J+ ] x- g7 `
return;
7 p h2 E! W9 R' | s5 T2 W* X}
; b Y, `/ t/ j5 ` ! p* _, V/ d. F% C( w
var count = resultItem.getItemCount(); $ u: F- S$ |2 H6 a' y+ k4 v
for (i=0; i<count; ++i) { 9 z2 l! _( f* n2 v$ _) J
var item = resultItem.getItemByIndex(i); 8 i6 \$ `/ W! ?; T" R: b
} " b8 s! k# B6 E" o5 b1 {; a
( O$ Q$ E, f: ^9 n |
|