|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
# M& R* t) @$ j" Q5 _4 ~4 l2 A6 OCreate an Item Object but use the Item.loadAML() method to populate the Item.
' f0 ]+ y- o- Q
0 a. l) u, K& K+ S$ q0 r
D( x* C: c ]7 d; pJavaScript 7 i4 f3 [6 Q0 | }2 C/ C! C
var innovator = new Innovator(); $ x$ t( d1 b" }. u) [# e; {1 f
var qryItem = innovator.newItem(); ) _) ^0 i- [2 o j. C/ E; D
qryItem.loadAML( 9 ? T3 Q$ S- \
"<Item type='Part' action='get' select='item_number,description,cost'>" +
, _3 U1 f. @" b8 a& a- q" E( A. @( f7 O "<item_number condition='like'>1%</item_number>" + + ]) _" { Z# C1 ?- d
"<Relationships>" + 8 O1 v0 f& R) S9 p% O2 O
"<Item type='Part BOM' action='get' select='quantity'>" + ' c, u0 \4 h+ R( }# O
"<quantity condition='gt'>1</quantity>" + * H7 n' v. C: V) Z7 l3 m: k
"</Item>" +
# \5 `* _: b, f% f, ~ "</Relationships>" + 8 C* e0 Z D; m7 k7 V4 d
"</Item>"
! r+ T, |( x7 d) p' ?); : `$ p8 R* _& h9 e4 |8 p
1 q' I3 q: Z7 u: b+ i' t8 e4 P4 Fvar resultItem = qryItem.apply();
# } N6 w( l2 G9 Uif (resultItem.isError()) { 7 ?1 Q4 N( M4 M( w/ T+ Q0 W4 f
top.aras.AlertError("Item not found: " + resultItem.getErrorDetail());
1 @- u) b8 K# n return;
% P& T& m% V% E- N8 z7 ?, t}
7 r( b6 Q& ]# A6 @ + K' Z! t8 [: p: _; J
var count = resultItem.getItemCount(); . p0 ]: a( F" u4 [$ ~
for (i=0; i<count; ++i) {
9 [ o3 U2 A( P, b: O& ^. F% j, B var item = resultItem.getItemByIndex(i); ' g7 T# s; B: j. @8 ^' F$ [) L6 w
}
7 M& X! V: f; z# c& R# M2 B D8 L# Q( T! F
|
|