|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
1 V! e6 p+ R9 F4 R' _1 S: T5 `) Q通过IOM
& A/ z) u& F/ y* u$ w5 l
8 E* u! }& c1 @3 |6 y SJavaScript 0 g# z% ~! z) T5 ~7 ^. B
% d o( G7 ]% K- n* U2 {/ i# W
0 P/ m) G+ {* d$ W
var innovator = new Innovator(); + X) m5 T6 n. k5 W2 b
var partItem = innovator.newItem("Part","add"); 6 X$ s; V" O( `! M. x6 l+ w
partItem.setAttribute("leaveLocked","0");
" U7 [/ U' R& Q' H: x/ y) ?partItem.setProperty("item_number", "123-456"); 4 e" |2 O+ A( k+ I, S, Y( N
partItem.setProperty("description", "Blah blah");
# O8 c/ M/ K$ H5 k' {0 k- D# l" s - S/ w4 i5 K* c2 g
var bomItem = new Item("Part BOM","add"); 8 M$ e5 S& Y2 U
bomItem.setProperty("quantity", "10"); 7 }2 `6 ^/ L7 y7 p! I2 z2 Y s
, i8 |+ I# Y; H5 G2 f( B2 Z9 Y$ @1 \
var relatedItem = new Item("Part","get");
1 d8 J; `9 M8 ?6 D8 w3 _relatedItem.setProperty("item_number", "555-555");
* \2 i1 y7 a# [+ a; l 5 B+ l9 i5 m9 H0 ]
bomItem.setRelatedItem(relatedItem); & U2 E& N7 c4 I
partItem.addRelationship(bomItem) ;
- \! F6 `# x* U( H6 ~# \" ?/ B/ P 9 @( v) t3 J, ]5 u% K
var resultItem = partItem.apply();
2 L, c+ S" o. N6 vif (resultItem.isError()) { g* J/ Q8 M; m; M
top.aras.AlertError(resultItem.getErrorDetail()); $ j; L+ r2 o2 ?5 I6 f0 u- b5 Q( p
return;
* P/ B1 t! j# E+ e( a( u0 C6 T}
$ ~6 L# H+ f/ Q$ y* g0 F% F1 U6 I9 ]+ Q7 y* V5 U% }
) W1 ]5 E% E* y& G2 }/ _1 @: Q
3 n- H* x2 D5 g8 _7 {4 o
4 U3 K. ]% i. T J n& o. c4 c
4 L9 ?0 m$ d/ a1 Q5 G! d8 B( R' H6 |4 jAOM方式0 W& D |4 y( c" y' C! U/ B
6 t( g y1 {2 B$ G$ @+ ~5 x! F; G6 e/ i6 N8 c
JavaScript
7 z4 K! L, w: e# @) g* d. ^) nvar innovator = new Innovator();
. g! o. R" E% v7 u0 r5 avar partItem = innovator.newItem();
( D8 b2 @: {: }- ^* s. G2 fpartItem.loadAML( 5 |* |- ^" P: ?0 `7 K1 Z
"<Item type='Part' action='add' leaveLocked='0'>" + 6 a/ L, O' \. G) n1 Q, h/ r
"<item_number>123-456</item_number>" + ) k# T( A' i4 L _
"<description>Blah blah</description>" + & Z4 d7 Z( v S
"<Relationships>" +
4 c& E( W3 P, {! j) [- q* Q; G "<Item type='Part BOM' action='add'>" + * E' Q5 b, a) }
"<quantity>10</quantity>" + % y# \" o: ]' ^, P
"<related_id>" + , M/ F, U3 b. N" e- o
"<Item type='Part' action='get'>" +
" N8 h9 b5 T$ _" o o. N& i "<item_number>555-555</item_number>" +
: ~- N1 P3 u0 Z) d1 S "</Item>" +
6 J; g+ ?1 h5 Q, `# y$ I+ Y "</related_id>" + ; o& |( {5 @- ]/ p: [- d8 b
"</Item>" + $ _! C' W I) q$ ~# J
"</Relationships>" + # f& F+ _9 T2 y0 U5 o9 j
"</Item>"
1 O0 n2 r* c/ c+ ?: K% T% \); 1 A- w* _( p3 G- |
2 k9 t9 k5 r [7 gvar resultItem = partItem.apply();
4 ?# _- {# `+ }5 E, F# j5 b% `if (resultItem.isError()) {
# p2 G8 j H* ` top.aras.AlertError (resultItem.getErrorDetail());
: B6 M4 u# }7 @4 T) [. C5 } return;
7 z8 e, _# a" L% j/ F( S3 Z} / I' R9 u4 a" h( |
6 G6 b, s1 V* a0 G1 \1 u |
|