|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
2 p. x$ M8 f# p+ C9 h
通过IOM( Y5 c0 v; n; b
- ^1 \5 i; [5 x( }
JavaScript 4 W5 S7 Z. R; x2 Q
. b2 g/ z; Z/ t @- e8 I2 B
/ s' e/ X* |: m; n3 g
var innovator = new Innovator();
8 h9 H( c+ k4 Y; m7 D6 xvar partItem = innovator.newItem("Part","add");
0 C6 Y% w" D9 t3 P: PpartItem.setAttribute("leaveLocked","0"); - @8 L! c" W; y# ^6 r7 V1 e% w
partItem.setProperty("item_number", "123-456"); 9 ^: l8 m; z5 J( p: q2 ~
partItem.setProperty("description", "Blah blah");
9 S$ U! b# x; Z ~ T8 ~9 d: A7 Q
var bomItem = new Item("Part BOM","add");
1 p, u) Y) D3 [bomItem.setProperty("quantity", "10"); 1 _; K6 k; c4 [; ^2 f: B' M
; P& N% Y) m0 ~. I$ F8 Q) Hvar relatedItem = new Item("Part","get");
* ~0 S* j0 A. | irelatedItem.setProperty("item_number", "555-555"); ! o- a9 d. _- V8 {2 l
8 k7 @9 H( F7 n/ D: @5 U( cbomItem.setRelatedItem(relatedItem); h3 U1 y7 n+ K2 k% J8 {
partItem.addRelationship(bomItem) ; 0 S8 F5 X# ~& w( H* P
, a4 `/ I3 n3 `1 _; b( P" ?
var resultItem = partItem.apply(); . @* } ^- f6 ]- s
if (resultItem.isError()) { - `. c8 P* m3 e% X! W
top.aras.AlertError(resultItem.getErrorDetail());
7 S" s4 h8 O* G( k return; * T1 S- m1 N) r% s
}
) o ]) |$ ^3 |5 `* _0 U& d: q
' y* |2 {( K I* p- z; T+ _3 a1 ]9 y0 R+ p4 A2 A
( K# Q7 b+ J: \5 S2 i) c5 P/ Q: O
i. w% x' x" U
AOM方式. Z7 J( K) d) k% z3 F
; ]. e: O" W. ^, I" L G/ n2 G" s E+ k/ v) k( ?6 D* t
JavaScript # ^0 N9 W2 w2 S% f" S( n! j" [# X% l: s
var innovator = new Innovator(); 3 B/ j- [# e& V7 j4 ^" W x
var partItem = innovator.newItem(); 4 {, \/ E( v) S1 G( @' a
partItem.loadAML( , G& f# |5 e( d( E1 U9 q, @
"<Item type='Part' action='add' leaveLocked='0'>" +
2 O Q( C! a& g- N "<item_number>123-456</item_number>" + 6 V* N6 S6 D# U l3 @: }
"<description>Blah blah</description>" +
: S3 C% j7 V8 Y0 r6 t* b "<Relationships>" +
, l; U1 `* E" J( ^$ p% s "<Item type='Part BOM' action='add'>" +
9 S9 f% Q% B! G "<quantity>10</quantity>" +
" t; Y: f6 F0 A0 Y "<related_id>" + # T! B" b& W) |: O9 w+ y
"<Item type='Part' action='get'>" +
- Z8 \2 U2 x' N8 _7 h8 f$ K$ h "<item_number>555-555</item_number>" + , C9 ^) Z( o" ~) I4 U$ l: i
"</Item>" + 0 v) @3 E2 a* P* Q8 R' O
"</related_id>" + , e' | Z2 p4 w: ~! B- Y4 ?- h
"</Item>" +
8 K6 j' \# O* D, T& ^+ V "</Relationships>" +
/ n* T) m- U, M: D "</Item>" . L9 I2 U; l- \3 c* f5 v
);
; D& s) Q9 b ~) V7 l" w 9 A0 S; g7 X3 W5 S: H
var resultItem = partItem.apply();
1 L% G' V1 E; C% oif (resultItem.isError()) {
' `0 T# i b% h& X# [' i top.aras.AlertError (resultItem.getErrorDetail()); * R5 g1 n. z/ L
return; ! \* m$ V0 y2 P7 \) H! s) {
}
" R) N, W( b- c* a: X" ^" _4 X- |0 G) F* ]* H4 a# O/ l! V
|
|