|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
3 V$ z* q/ D" L" o( z0 K% kCreate an Item Object but use the Item.loadAML() method to populate the Item.
8 e3 \8 U h. V6 B6 B& d* I' {- |3 u1 C# F- U4 [
* J( O' |2 v4 g8 Z: C" f; qJavaScript
* y/ U: Y U& N4 K; ]7 e* u& ]) Svar innovator = new Innovator(); 5 }& n, l+ ]7 D2 N7 A& e) j
var qryItem = innovator.newItem(); 3 u; F& Q7 i: l4 S: E- y) `
qryItem.loadAML( 0 f* f+ r) G$ v- ?2 Q
"<Item type='Part' action='get' select='item_number,description,cost'>" +
) G- \, b' y6 U8 K6 O3 I "<item_number condition='like'>1%</item_number>" + ! |7 V7 o& [: W* {" I& Y
"<Relationships>" + " G% f7 a! f* N5 i, L& n# b
"<Item type='Part BOM' action='get' select='quantity'>" +
4 f! H) x8 Q- W0 K8 _9 s$ \/ u "<quantity condition='gt'>1</quantity>" +
) {5 d+ L5 K, }8 s8 ^ "</Item>" +
( W* b( A g% d" y- } "</Relationships>" +
. N% R" _. s7 {6 d& X' T8 | "</Item>"
4 a2 ~- W0 Y4 ^4 H3 M5 l);
9 }# t1 ~. F- Z- V- c4 @
( Z% i, p6 b8 t& b% H: Mvar resultItem = qryItem.apply(); & R8 o" _" U2 p6 o, ]2 Z
if (resultItem.isError()) {
, s7 p) K1 T0 f- Y P top.aras.AlertError("Item not found: " + resultItem.getErrorDetail()); . o" s9 P5 J* R# h
return; ; d, j: p' q9 c3 M- M0 K! n1 O$ n
}
1 H5 `9 _) ? j2 [% r! Y) I
& [& T" {% u" ~$ ^1 d5 F0 [var count = resultItem.getItemCount(); 9 x7 T0 p; T7 n) q% O! w, l
for (i=0; i<count; ++i) { ( ?, g, d) t7 J. w- S% n! i5 \
var item = resultItem.getItemByIndex(i); * q/ V _5 B( l
}
5 K- B( X9 K5 J8 [) W. b* D; S: w' h
2 X& _6 C. T' |% P2 F- z6 T |
|