|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
! e( {+ U* g& bCreate an Item Object but use the Item.loadAML() method to populate the Item. 9 x% Z" ]9 ?9 \! D# T, @
$ D* q2 m% S2 p* S
- s, P. q- F* ~- i$ ]3 ]JavaScript # Z0 G! U5 \" ?/ J# J; i
var innovator = new Innovator();
9 {! k/ S( V! w/ [& Wvar qryItem = innovator.newItem(); 5 m+ |+ i! F2 S' n0 U4 e
qryItem.loadAML( % y; i* Z" D2 X, T' x& \
"<Item type='Part' action='get' select='item_number,description,cost'>" +
" H6 s/ L! P. |) q/ N7 e "<item_number condition='like'>1%</item_number>" +
0 ?# Z' E0 j/ Z1 X" r "<Relationships>" +
- K' s4 r1 {# a/ ~' { "<Item type='Part BOM' action='get' select='quantity'>" +
" N- E9 o' I. i) _: t "<quantity condition='gt'>1</quantity>" + 6 N% \/ G! c8 @* X" S5 _- X' `
"</Item>" +
7 _7 T% S* g- J "</Relationships>" +
* ]4 y* y+ f* [: d) h "</Item>" 3 m T/ w& Q* ?$ h) ] g* w2 V% S
); 0 l: s. n8 j) N# B+ n
9 |# z5 k% S L4 @var resultItem = qryItem.apply();
1 @& a: G. A5 Q& K$ uif (resultItem.isError()) { * T& i- O6 J* K+ F5 i, |
top.aras.AlertError("Item not found: " + resultItem.getErrorDetail()); 6 v N; U. }: S$ z d5 @
return;
& x6 Q! r, c; b} 9 ?$ b7 I4 W5 n
0 E* t1 D( I5 g4 ^) }var count = resultItem.getItemCount(); 7 A* V# b) Z0 O# D: ^. |- B- c
for (i=0; i<count; ++i) { . R8 A; a6 X( [. F8 l
var item = resultItem.getItemByIndex(i);
* u/ E( ~0 G2 A) t% d) D6 }}
4 p- O( N) }- z3 A; P9 ^7 H
2 x; T* z2 {, j |
|