|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
: w. _) h6 \! X- N
通过IOM
' {* }2 a+ P9 I+ X3 W+ Y6 k3 k" D0 h
JavaScript
8 M/ n/ k+ q9 G; F+ R2 M% L; O+ f4 X6 ~" j; U0 ?# T* b, `
/ b& j" |7 s+ [
var innovator = new Innovator(); & y9 T: n+ z6 h0 v
var partItem = innovator.newItem("Part","add");
" Z7 o2 `6 K9 V8 cpartItem.setAttribute("leaveLocked","0");
: B9 c: E1 r* L6 `partItem.setProperty("item_number", "123-456"); ' C* n- Q" t7 I' q- ]* i
partItem.setProperty("description", "Blah blah");
$ _/ b3 h) [5 ?% B0 d" Y: {/ `
& |# q! ^. k- z" Bvar bomItem = new Item("Part BOM","add");
' c6 @8 u0 C6 h! U- E/ x7 ubomItem.setProperty("quantity", "10"); 3 ?# r& k! x# D7 e( [) P; H3 b
9 c* B* d: m2 {$ D" d, C+ w
var relatedItem = new Item("Part","get"); 0 f8 y6 `/ m0 m* P& r! S
relatedItem.setProperty("item_number", "555-555"); % r) l3 a3 l! I
9 D4 L' z0 l8 c" AbomItem.setRelatedItem(relatedItem);
, S6 ?! V# T GpartItem.addRelationship(bomItem) ;
5 T( `/ H; U( w( t, R9 j6 v: z
% t+ s6 l. y0 e8 n# }# hvar resultItem = partItem.apply(); : m6 q+ \0 w5 u% u# O
if (resultItem.isError()) { # Q8 P& n6 J( T% }
top.aras.AlertError(resultItem.getErrorDetail());
6 b3 ?- f T& O# K6 N! i return;
! C5 l% X4 w. J; V6 ?$ I. j9 U}
; C8 S5 T4 O( G. i' L- b& n( W; A2 ^2 G3 o2 l
8 @( _; W/ j) C2 n3 I% Z m
, L8 f# J) a! x9 N. u5 q- z5 r
/ a0 Z6 k) X0 a) a( G1 v0 W8 q9 a5 p% k' h
AOM方式6 z) v% B4 [ o: H& N5 z* p& L
/ i* s4 C, {' U8 E2 J/ g; x! Y* t) G9 O! v+ [
JavaScript
6 _: Z( e# i- ?1 U) r$ A$ ^var innovator = new Innovator(); 2 n. h u* f+ {, p" L- A
var partItem = innovator.newItem(); + \+ @. d8 p% f4 m |" f
partItem.loadAML(
: b) E8 J5 E) j "<Item type='Part' action='add' leaveLocked='0'>" +
/ P( O3 G1 ^' ~5 Z9 D$ r* q, s/ O; \ "<item_number>123-456</item_number>" + 2 M. f1 z- W) w* |# r
"<description>Blah blah</description>" + ) t# T/ {& L/ y* j; W2 u& f, N
"<Relationships>" + : @+ j, }8 L) ]. s! c/ a+ y
"<Item type='Part BOM' action='add'>" + 6 Q5 L2 w# G x; q8 ^
"<quantity>10</quantity>" + 0 I0 w% k! B) t
"<related_id>" + - C4 w$ D9 A$ N! W3 N# i2 ~, n
"<Item type='Part' action='get'>" + 6 x: z# T8 m- `$ l: w% e
"<item_number>555-555</item_number>" +
3 k, s4 i1 s$ L) s+ | B8 | "</Item>" +
, y# K/ V5 X9 A! L+ v "</related_id>" +
* I1 V4 C7 h2 Z: J1 |8 e "</Item>" +
) U) V- ^# [+ H- b5 I i5 P "</Relationships>" + ' _* |% V1 u. T( T0 r) N6 v
"</Item>" ( H3 g% |* Z/ j( t* }5 f
);
& \1 H+ d8 c% N$ G$ X: [
! x: b- ^9 ^! f M6 X# C' Kvar resultItem = partItem.apply(); / v6 Y" u8 g: Q' g# g
if (resultItem.isError()) {
& h% T, Q. t5 M$ a! P top.aras.AlertError (resultItem.getErrorDetail()); * n1 N3 j% Z" y9 g1 Z' n9 u
return;
+ b2 G. i, c) B( S& M: r3 I4 M/ I}
4 V8 Z5 c! _% F0 \4 |
3 b* T, S+ \5 j% p |
|