|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 6 J! J0 K3 d; h- j0 Z- N9 d
Create an Item Object but use the Item.loadAML() method to populate the Item.
) d3 I: @) |4 a
2 z; A" r4 W2 A% ~" s5 I: k) a% r8 D1 C$ d" V
JavaScript
" e/ H) d3 k Zvar innovator = new Innovator(); $ l" K' E# r J
var qryItem = innovator.newItem();
: m: a. R: ^" O( pqryItem.loadAML( & A+ N( Y' `- K, o
"<Item type='Part' action='get' select='item_number,description,cost'>" + * v0 }4 O+ z- P
"<item_number condition='like'>1%</item_number>" +
6 a9 }9 _- k, q9 ~1 u "<Relationships>" +
8 j4 f# }% j( c# ~% W9 v. O "<Item type='Part BOM' action='get' select='quantity'>" +
2 Z& U2 y& P2 Q5 T2 X( s) c "<quantity condition='gt'>1</quantity>" +
) P) R: O' e5 i9 z4 Y$ h "</Item>" +
! I" u0 T7 f# e; P "</Relationships>" +
/ [8 s z% d4 Q( X) ` "</Item>" 8 H8 ~. E$ L; Y+ [# P) J
); : f: @$ L, C& F2 \
6 h+ o( \5 M d4 [# o9 j8 }8 h: X
var resultItem = qryItem.apply(); 4 P, t- ~/ W! d! X& c9 {0 {2 a
if (resultItem.isError()) { ) n/ w% P1 g# r5 S/ e$ X& O k
top.aras.AlertError("Item not found: " + resultItem.getErrorDetail());
$ I9 M& Y# ?' O9 x; D2 P/ x6 m return;
8 t! |! ~1 N7 S, t} ( `" P" T+ D6 v& f1 C* T. h2 ^
0 ]: I9 x' W4 L$ ~8 H5 ^# J
var count = resultItem.getItemCount();
: F! n% _ u; u: O Tfor (i=0; i<count; ++i) { ) z$ o' _% T! p$ z% Q9 v+ t8 S; i
var item = resultItem.getItemByIndex(i);
$ ?( E: R' _; c# C: e}
" o3 I+ M# z- E7 I# K5 u& {- M9 R( M6 `* {' ?- ?6 [* P, I9 |
|
|