|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
5 u% ?: H5 O7 p8 ]; |
通过IOM
& ^: h% O' F$ \" N( w5 F0 B6 E7 H1 r5 B2 N
JavaScript & f, E7 D! K0 s
" w) {) g8 E6 z* R
: I G" D# u9 j# A$ V( K- T" J8 Kvar innovator = new Innovator();
" {- B( u5 r9 f4 t' _. i6 Ovar partItem = innovator.newItem("Part","add");
# h4 o4 }8 s' p) T: U2 fpartItem.setAttribute("leaveLocked","0"); # T+ G* H: t% ~8 c/ ~: J
partItem.setProperty("item_number", "123-456");
/ U: M4 W8 y! L& }2 a8 zpartItem.setProperty("description", "Blah blah"); ) m9 S. M, u9 ?; z3 l
4 E4 O6 k. d. S; B
var bomItem = new Item("Part BOM","add"); a0 M f+ C. w/ I$ `% B" v
bomItem.setProperty("quantity", "10");
D+ K# b3 M+ K0 E+ ?
% ~+ d8 S7 _% o; h" ^9 X! h6 avar relatedItem = new Item("Part","get");
( G0 \) D/ T/ n; v: A3 F* c, A; crelatedItem.setProperty("item_number", "555-555");
2 e/ |% W1 W2 L z) v- s% k/ r+ w - @4 K+ c- ~! w9 `, o1 w! c
bomItem.setRelatedItem(relatedItem); 1 O& O7 K p' ?# p/ P6 a
partItem.addRelationship(bomItem) ; 3 P, u8 d' c) ?, e4 @% E
4 _& g! H4 p/ [
var resultItem = partItem.apply(); ' l5 O9 a5 W1 V' z3 S5 D0 s
if (resultItem.isError()) {
, x/ n0 n% Z7 K: x* w4 }6 ]+ i top.aras.AlertError(resultItem.getErrorDetail());
+ E# I7 t. i- [- H return;
P% z: \) N$ X; j9 X$ s} & B0 s) s3 n' p+ D9 P
0 c8 _$ W( w+ d0 ], v( Q8 [+ n2 W# l h% o. V
3 F$ g$ P0 A8 K( x
* {, `0 |- O) l, ^0 \7 K$ d8 M
+ z1 V* A4 ]( l' F
AOM方式9 N9 I6 D4 r3 D4 \5 L
7 \0 R! C0 q$ H
3 D6 \$ K. x- K `" C+ \
JavaScript
( x: O" V: _1 [1 evar innovator = new Innovator(); % z' h! Z8 V* u
var partItem = innovator.newItem(); ( f4 E) L1 O1 U# D* d$ z2 h
partItem.loadAML(
; C# P4 E" H) Q$ F- u- r "<Item type='Part' action='add' leaveLocked='0'>" +
9 d4 M w% ~) {- I+ \: B) s" s# z! w. M "<item_number>123-456</item_number>" + ) ^) g2 T8 s7 O' J& A
"<description>Blah blah</description>" +
) h* k) d. T* f5 n "<Relationships>" +
9 Q8 ]$ Z" s6 {/ }5 l3 G% A! j8 M "<Item type='Part BOM' action='add'>" + 8 D7 A1 h$ x9 O
"<quantity>10</quantity>" +
7 J$ p) M8 w9 I9 ~1 ` "<related_id>" +
1 I! [% y- q, a0 P& h "<Item type='Part' action='get'>" + / ?! m0 k0 Z" @6 P% ?1 p) @' o" x
"<item_number>555-555</item_number>" +
) W! Y6 V) r& w) S# F- o& W "</Item>" + . q# j# z8 u6 g
"</related_id>" +
; M9 Q# u' [3 I' y "</Item>" + 8 _+ k+ ]% h. e4 x$ q
"</Relationships>" +
" q+ N- g5 A! L* Z: x; D "</Item>" 5 ?& D) K L1 o/ X1 l. W) U
); # F# ^8 ]$ o# ^) h. l7 ?
# R0 V+ \ R% }8 M, }4 r
var resultItem = partItem.apply();
* z( n( w$ q& |1 Yif (resultItem.isError()) { * i' v. s0 U5 `
top.aras.AlertError (resultItem.getErrorDetail());
( m$ f( i! a5 m" H1 @ return;
) X! F# l1 @2 T! |' T}
; C5 N9 S- h- V" N' d/ \, [$ w' e- i& L. r+ L$ N$ K
|
|