|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
* m! T- e% j7 o
通过IOM
0 p1 r: {: d P @9 \& D5 L) H2 A; K+ `4 s: E# |5 |! |' }
JavaScript
! b; \/ q: L! ?6 b
! j+ d; J" w4 ?4 {* _+ ^, v# ?
/ T' h {5 ]; k. @0 ]var innovator = new Innovator();
. w, i+ u. B3 c0 C1 S$ k% f, qvar partItem = innovator.newItem("Part","add");
" X8 _! A8 F5 x; G0 Z f' [partItem.setAttribute("leaveLocked","0");
% n7 S" n1 x8 P; Q" rpartItem.setProperty("item_number", "123-456"); 2 V! a+ H. g5 p) e
partItem.setProperty("description", "Blah blah");
* i: x9 n- m0 f" d7 |
" R- H3 n# \9 E5 U Gvar bomItem = new Item("Part BOM","add");
0 \8 b i4 D+ a5 O kbomItem.setProperty("quantity", "10"); / ^( I% M; m0 l
, ~& {& H) ^: }7 i
var relatedItem = new Item("Part","get"); 4 }9 q' T# H# V! p
relatedItem.setProperty("item_number", "555-555");
: B. u) F6 e( q. D8 q- ]
4 n( I5 |1 u5 q- TbomItem.setRelatedItem(relatedItem);
5 r' s3 \! k( b- n( }) mpartItem.addRelationship(bomItem) ;
' k, G" D; z- `. j5 w
0 g' x4 y3 w) }3 a6 K; R5 Dvar resultItem = partItem.apply();
6 |9 j- _! t# ?6 ^ dif (resultItem.isError()) { - l$ F" p. O* O; v/ f0 y3 C
top.aras.AlertError(resultItem.getErrorDetail()); 1 t& G2 g1 }$ u" e$ J2 S. N# I7 R
return;
_: m. D; v1 w+ _& i* P}
2 i% u$ }3 M% Z# n$ f" l" y/ u4 y! S R/ J
- |+ Z/ G0 |, B" W4 U) Q( I
# w: \) q4 q* c$ L/ | [
6 Q0 u! w) y9 V) L$ T8 }
) n5 l1 j% U8 `2 _ @3 uAOM方式
4 i5 e0 K; b. A# b* k2 }
. o f. `5 c4 n2 O3 s# U. k' a4 b9 ^5 g
JavaScript ! F1 K) m5 ]5 X8 \4 Y" ?
var innovator = new Innovator(); . y1 l9 t. U/ ]7 R$ t; r
var partItem = innovator.newItem();
; V" m- o& E! S4 n. x rpartItem.loadAML( / N9 t9 a8 ~9 i+ p3 d4 M7 o
"<Item type='Part' action='add' leaveLocked='0'>" +
$ v# [9 q1 E7 N g2 S4 n+ Q. C "<item_number>123-456</item_number>" +
: U, X2 _$ Z6 f& {- p4 T5 d "<description>Blah blah</description>" + 1 b4 q" |2 o: X4 o$ C& Q
"<Relationships>" +
/ @: q3 x8 ?/ E. }9 d6 X R( I( M, h "<Item type='Part BOM' action='add'>" + : q/ x4 F6 b' m9 U' }' D
"<quantity>10</quantity>" +
1 L& Z' m) I* `8 v! U8 G4 w "<related_id>" + ' c& K" h1 f: e' A ^2 I
"<Item type='Part' action='get'>" +
% ]% m6 D" A- S "<item_number>555-555</item_number>" + ' K* N! W% K: y5 Y2 g+ P& w5 _8 F
"</Item>" + 9 K$ f' j( z/ t+ V4 Y- c# } h
"</related_id>" +
( B& x8 t( R) r* i7 o "</Item>" +
1 q* B8 \! W {: f2 u "</Relationships>" + 3 A# [' d- f$ L- g3 o1 M
"</Item>"
4 p. ~3 T u# V. t6 j2 {# A);
) R; L8 l: F/ F' ~ U & I& e7 X0 R; w" z
var resultItem = partItem.apply(); 2 f- t3 u- ?+ R6 b. g% e6 E
if (resultItem.isError()) { : e7 H% Q+ Q9 Y( T g& Q K
top.aras.AlertError (resultItem.getErrorDetail()); , r1 B; T; Y. t: B6 K3 M
return;
: f! A( Q$ H* v} # v, f- s6 L# Q& n- d7 b$ w
* m) h: x+ y7 e! x
|
|