|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
" A4 `$ K% ~9 M9 l
通过IOM: k( F) o! k/ C+ x# x4 ^. J( ~& q
. Z! ^! C/ z' ^. D. }/ ]* F
JavaScript 2 _+ \0 R( z$ R' d; i3 {
* ?7 B- D! _$ T7 i
$ K0 R6 B! ~ f5 _) c. ]1 Tvar innovator = new Innovator();
2 ?/ G/ ]1 F( l) ~; c+ Jvar partItem = innovator.newItem("Part","add"); 1 N' v, ^! `8 `
partItem.setAttribute("leaveLocked","0");
( K3 K8 X: b" V( }3 S WpartItem.setProperty("item_number", "123-456");
^) k& i3 j- C5 _- }3 [partItem.setProperty("description", "Blah blah"); . W, E2 o+ U9 E5 A
6 }$ L% { f# Z3 W1 Wvar bomItem = new Item("Part BOM","add"); : w/ O" h, I* m3 G
bomItem.setProperty("quantity", "10");
& D- B. f+ U4 ` % }' A/ _" s9 C' M
var relatedItem = new Item("Part","get"); " a( ~% X `, L1 t! c
relatedItem.setProperty("item_number", "555-555"); ( a1 k# f. x( B9 T7 t
/ ~+ @ m, b' N7 h) `
bomItem.setRelatedItem(relatedItem);
* S2 ^0 L% W: a/ dpartItem.addRelationship(bomItem) ; \' ?# _$ l* h& J! X0 n- b
4 m! C, r( }$ |) V' s9 S2 qvar resultItem = partItem.apply(); . k3 D2 O+ Q+ ^) [) o1 j# U
if (resultItem.isError()) { + k& w1 R3 G6 h) F1 @
top.aras.AlertError(resultItem.getErrorDetail()); o! S0 F" u7 n- q- ^' \
return; : m' B2 e( v& r9 U8 E; E. E
} 2 b# {4 d0 f% p& Q- G$ U
2 e" b2 y" E: P2 N# r% m m) x/ J
5 y M# u& j+ f$ q7 i
+ I0 w' ]7 {( x& @/ J, _& L
' c d4 m4 w& h7 E: q
/ Y0 J# K1 f- m I P& @+ ?1 i- o, gAOM方式
" r7 k0 r; |3 x7 t/ ^3 G; @* c7 m% l1 q9 l! q! ~$ v: J
0 f- Y' n* D9 M) t, e& p2 ]2 j5 a
JavaScript
$ d* X8 Y' W& [ c. e) S) {( y6 H$ Wvar innovator = new Innovator(); & ?9 a4 _; U2 |$ Q( v# N w/ ] u
var partItem = innovator.newItem(); ! Q: l v$ F# d7 `: _+ `& H
partItem.loadAML(
6 F9 D0 J1 P$ h/ j, D "<Item type='Part' action='add' leaveLocked='0'>" + 7 t' E- Q. k. {
"<item_number>123-456</item_number>" + 0 x1 p5 M* z' w, i, S
"<description>Blah blah</description>" +
% z+ \7 e, x; E9 R: h% T "<Relationships>" + 4 E7 @1 t0 O. \4 p6 l2 y6 D
"<Item type='Part BOM' action='add'>" +
2 b+ T7 c. C; `( c, A% f "<quantity>10</quantity>" +
0 N. ]$ k+ _* S# [& o% R! N "<related_id>" + 3 N; I: F9 X: B! G
"<Item type='Part' action='get'>" +
* T F) i6 q8 D& I! |3 m3 Z "<item_number>555-555</item_number>" +
! S# C" F, B/ f, ]+ S: g "</Item>" +
5 K, _2 m) O6 w "</related_id>" + % W# j; ^4 S/ l0 m' \# |& S* }4 z
"</Item>" + / L, _8 r: H8 u* y' x
"</Relationships>" +
* l! Z0 @' r0 G* r" H "</Item>" 9 K+ Y* M$ B* P0 ^1 I1 p9 Z. @
);
6 r! u# r7 u; s 6 j$ u5 ]& Z# s% I" C
var resultItem = partItem.apply(); v7 v$ D' r% ^- `; E: S
if (resultItem.isError()) {
5 N+ `4 o8 k' Q: }# a top.aras.AlertError (resultItem.getErrorDetail()); ( N9 \* W3 V' W6 V, D H8 f' g$ [
return;
& ?: W+ n" o3 t0 q Q$ r}
z8 L) v2 m( s: p p% F, a4 e3 d- x0 y3 z: u" |9 X8 W
|
|