|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 6 P6 E( J; T7 ^
Create an Item Object but use the Item.loadAML() method to populate the Item.
' i9 Z. I2 y" A5 k2 P- H5 x2 t d5 a
8 a1 a8 ^5 ^, Y, v8 ~
JavaScript 8 J0 R4 R8 s9 Y) X& G5 i' }& o
var innovator = new Innovator(); $ `) t) O) G+ |3 I) |& Y
var qryItem = innovator.newItem(); * g+ J! D4 l3 U
qryItem.loadAML(
5 i9 O6 D* ]/ ^1 E! D. Q "<Item type='Part' action='get' select='item_number,description,cost'>" +
3 k9 y* Y1 p* }$ T7 I- E+ ^ "<item_number condition='like'>1%</item_number>" +
' V8 P9 S, r, p% X# j "<Relationships>" +
8 b, }9 T4 G3 Y" G "<Item type='Part BOM' action='get' select='quantity'>" +
" p* C6 B" {; O% r, p( S! n" T& u. ~ "<quantity condition='gt'>1</quantity>" +
( Q* d' u8 U0 H8 P, @% C) g: E& u6 a "</Item>" + ; i, x( y: G+ O
"</Relationships>" + $ n6 x! O1 z ?; V
"</Item>"
( O1 `% {+ f6 I% r2 X; a); {. s& t. u: t' [ {) d; t3 g
" x9 ~/ [# M# X2 t! q( q! E
var resultItem = qryItem.apply(); * n9 B- L8 s1 @: W7 n+ d+ |0 T
if (resultItem.isError()) {
4 p7 s4 X- Z/ K- ? top.aras.AlertError("Item not found: " + resultItem.getErrorDetail());
7 I# k# Y l2 E1 \/ b4 ^" s7 O; a7 r return;
0 o& [$ k5 c2 I1 H# \& [}
/ K5 E4 c5 D; p4 @! [ & G2 X+ d0 `3 D/ g+ j
var count = resultItem.getItemCount(); 5 y" h" |+ M8 S0 H3 U3 l4 ~& k
for (i=0; i<count; ++i) { ' E5 y$ D- @! ]1 `, h' O/ G* Y$ U/ W
var item = resultItem.getItemByIndex(i); + p" A( z2 `7 l* W ?" H0 D
} : P4 ]6 z" i+ f5 O1 Q
, w+ ?' H. [3 s& Y |
|