|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
( o" v3 [9 D; ^% b9 H* W* X通过IOM
1 w1 @( A& o; n4 Y) @; \* ^; F3 ^! L, O5 `5 W
JavaScript
/ h5 X; D9 M, H2 ~4 ] D7 _ s. F/ t
8 K+ @# C S1 z; N0 r0 P4 wvar innovator = new Innovator(); , T; A5 y& j6 I$ x; S
var partItem = innovator.newItem("Part","add"); ( }& P% l6 i/ S; a
partItem.setAttribute("leaveLocked","0");
; l$ j, Q2 f* X i+ {# CpartItem.setProperty("item_number", "123-456"); + R- t, E; A/ o$ r2 d# L
partItem.setProperty("description", "Blah blah"); 2 l$ m- b" {' _' B' g7 p$ _
' G. }9 C% f) }var bomItem = new Item("Part BOM","add"); * b# D$ f" \ J
bomItem.setProperty("quantity", "10"); 4 {$ ~ ?. k! I
2 S! {( e: ~ Y$ b- gvar relatedItem = new Item("Part","get");
d8 R' D0 m; A+ g1 \relatedItem.setProperty("item_number", "555-555"); , ^" ]# I4 _7 E" U# z3 N* t
$ F/ A& e7 M* x+ F7 l5 U* \/ ]6 z/ g
bomItem.setRelatedItem(relatedItem); 6 k. h) M9 D+ N+ I
partItem.addRelationship(bomItem) ;
0 U) }8 D7 g* n" _' @ A
, h3 G O1 H, H' V" G* Bvar resultItem = partItem.apply();
4 k' [: o- j* {7 Zif (resultItem.isError()) { $ W, [- s7 N, M! y
top.aras.AlertError(resultItem.getErrorDetail()); $ |. ?# g3 l/ P: Y7 q
return;
/ ^) ]" g" b+ A) `: ^} 0 R2 s; a% E) m1 A) ~
7 Y% g0 y; w# A( D$ I6 x2 k: E+ o# u0 j
8 e2 @5 K# j' @. W6 b) H
5 `2 J7 H A% e* U9 B
; S2 q3 K3 \, ^# G+ D3 O: }
AOM方式4 Z. i$ y, x: D3 {9 ?4 v. n$ C
$ D8 F- R: T+ T4 m% b7 B) }7 M; D
. W( P, B& L, w; l
JavaScript
( E+ l% U3 s/ X- m( B$ ?3 gvar innovator = new Innovator();
: H$ X3 i# s3 Zvar partItem = innovator.newItem(); # Z* D0 i. A$ W; M9 f
partItem.loadAML( 9 c* T$ z, a# q4 U2 o8 D
"<Item type='Part' action='add' leaveLocked='0'>" + " P" z f0 D' T7 m
"<item_number>123-456</item_number>" +
- O! a0 X( ~ h! v3 B+ u "<description>Blah blah</description>" + 8 Q1 r% w& R/ }) G. w
"<Relationships>" +
( B. F+ X4 t8 g: s1 O "<Item type='Part BOM' action='add'>" + + S0 J4 S- ]( `8 Z* A3 _
"<quantity>10</quantity>" + & a8 B0 u1 ~' Z
"<related_id>" + 2 e& m* u- [+ ?
"<Item type='Part' action='get'>" + - F3 D \# t. F
"<item_number>555-555</item_number>" + ( E8 g6 t7 B/ j* o( G8 U
"</Item>" + * J w% y2 J1 Y3 G J8 r+ d( ]
"</related_id>" +
8 P7 N* |$ C: S. } "</Item>" + ( i8 n8 h' G# F2 z! V4 `% I6 n
"</Relationships>" + , s/ O2 M+ Y6 q' ~! ]& w
"</Item>"
: q- [& ^* r" _- d. ?# B); 6 c9 F: {0 ?4 V' [- e' a
% Z; ^$ R: d S* v" jvar resultItem = partItem.apply(); ! _" x& U K. k, ^8 W
if (resultItem.isError()) {
2 _/ F* Y3 ~; {* E* f top.aras.AlertError (resultItem.getErrorDetail()); 2 u# p, A# y" H" o( V/ V
return; + y# S0 m, ~: E: j3 `1 s/ t* R& S
} : l" i3 y1 G4 M$ F* i
1 r2 n/ Y T5 x& t: U; f: |$ P
|
|