|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
7 c2 ^3 e- ?" F, T! i- F& S FCreate an Item Object but use the Item.loadAML() method to populate the Item.
2 W5 m* {! o S/ S6 n; c' O! c1 G V w& j8 J
3 Y7 _7 h: c# T L `
JavaScript
: U8 Y* _+ ~, {" H3 Uvar innovator = new Innovator();
3 U+ l. o& D8 x1 \var qryItem = innovator.newItem();
: Q4 T! P6 n: o* v4 ~5 \qryItem.loadAML( + y3 Z7 g9 S' o
"<Item type='Part' action='get' select='item_number,description,cost'>" +
# M0 a1 {$ v) K+ j* Q5 C- s "<item_number condition='like'>1%</item_number>" + 0 N9 M8 t! A- M/ e1 i+ b3 E8 D
"<Relationships>" +
: L% g& r* n3 d" p2 x6 O4 v8 r1 n "<Item type='Part BOM' action='get' select='quantity'>" +
; R0 [- A# e4 n/ m "<quantity condition='gt'>1</quantity>" +
! u: m, {3 s9 L "</Item>" + . Q. H6 |% N6 _& Q4 k; G
"</Relationships>" +
' u8 ] s9 m6 s d. ]% T "</Item>" 8 j; f8 g9 c9 g/ _1 }3 i8 a; m; ^
); ) f. D% b5 x3 H z. r# M. g) y* m; I
# |+ \! N; H" Z& Z# H7 B# W, \5 g
var resultItem = qryItem.apply(); . J5 Q9 r. c' f' C: ?# Y
if (resultItem.isError()) { 5 o3 b; `* q) e, v
top.aras.AlertError("Item not found: " + resultItem.getErrorDetail()); r: b$ h/ z; k' Z Y
return; , Z- D- A/ j- n* ^$ b
} 0 Y- K( b: e& t' {/ A8 {7 s
* u: r' _3 p; X" P1 x+ `
var count = resultItem.getItemCount();
, q( @+ x$ j/ K& h$ ?6 z) e6 Vfor (i=0; i<count; ++i) {
- P0 C/ m+ ^) Z- }; v. \ var item = resultItem.getItemByIndex(i);
; G' c+ V2 D$ }7 _% L x! I" O" A6 ~} 5 T; x4 r& F/ I; Y2 x4 I5 a8 P
7 ?% a# _6 ?/ M! E
|
|