|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique , T$ @! ^0 n9 \7 B! V: N/ x: u1 j3 `
Create an Item Object but use the Item.loadAML() method to populate the Item.
- n$ Y2 Y& c6 O/ P; q7 c; P1 p" S# t. v; [/ g) _
* q5 W! g' k7 A5 v( P$ eJavaScript 0 ]$ D( N7 k4 v; I0 p/ U
var innovator = new Innovator();
% j" Y8 P$ C" e% i( c. @var qryItem = innovator.newItem(); / @8 O" m O" G+ [! w
qryItem.loadAML(
2 N' f4 M5 |3 s, I8 ^1 c7 A "<Item type='Part' action='get' select='item_number,description,cost'>" +
1 p% A3 ]* m$ l- o; V; T6 c "<item_number condition='like'>1%</item_number>" + ) B8 l l3 p$ I& q* }
"<Relationships>" + 1 @3 q0 p( N. j& |3 }
"<Item type='Part BOM' action='get' select='quantity'>" + 8 F, N) W6 Q" G8 o6 Y# H! e, r
"<quantity condition='gt'>1</quantity>" +
& b6 ]3 y8 T0 w0 _ "</Item>" + , [$ L6 |9 i( W, a
"</Relationships>" +
+ t& L/ o6 J. r( ` W "</Item>" # \0 b, \1 h8 g, I6 N( G
);
& q* [+ }5 `; U$ I4 S0 M6 T 2 m4 H2 [. C# [9 J- k8 F3 Q/ {
var resultItem = qryItem.apply();
1 L- j7 ?7 Y5 L8 Y. A" gif (resultItem.isError()) {
9 A' e$ B7 ~2 \ top.aras.AlertError("Item not found: " + resultItem.getErrorDetail());
9 Z' D3 r: c; w5 u7 n. x return;
5 u5 o3 x& L, L2 F, g# K( E+ _} 9 r5 j& J5 X6 k7 V7 }3 d
: z9 N ?7 [- E# r. Cvar count = resultItem.getItemCount();
( @. @5 D: Z2 T" w2 Qfor (i=0; i<count; ++i) { % p; ~; B- }# i# _) d! B- c, N" k
var item = resultItem.getItemByIndex(i);
4 g7 a- k$ V# P" w8 u} 3 O6 Q% D5 m8 [4 F& G( o% ^, s7 U
5 w8 m( N) j! ]( o |
|