|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
; ~/ e5 @) p* t3 X% p; b0 S1 O! N
通过IOM3 A- K! p* E9 U n: T' x p* m
* x( p% E$ k# J p6 X5 w" ZJavaScript ! D* T0 a+ w1 L0 e. n
4 T, A5 F7 x# c
" n' p8 D! p3 S5 w; C9 }( tvar innovator = new Innovator();
( E2 L8 B$ f, U# Dvar partItem = innovator.newItem("Part","add"); 1 L- `, J8 A$ T
partItem.setAttribute("leaveLocked","0"); , R4 U v# m; r, Z# l9 ?
partItem.setProperty("item_number", "123-456");
! z- Z1 l3 H+ O( d* JpartItem.setProperty("description", "Blah blah"); 9 e+ p; J! r6 ]1 u" _6 ~* G
2 h/ E; s# M" e: @, Fvar bomItem = new Item("Part BOM","add");
9 J# ? K! x+ P4 v qbomItem.setProperty("quantity", "10"); 8 f; n4 j& W! B
* T p6 H$ E! g) m o" Lvar relatedItem = new Item("Part","get"); , Q" {* E9 o+ q; q9 W+ {8 t
relatedItem.setProperty("item_number", "555-555");
8 V0 i ^; K+ s+ E+ c- I 2 C5 f- H" f# ]( I5 M G( K
bomItem.setRelatedItem(relatedItem);
! ^) M1 C+ m0 ]4 o5 A5 w7 F5 cpartItem.addRelationship(bomItem) ;
" f2 Y: u, R6 M: I! G [- i 8 f, k) H7 E( l7 i7 ]
var resultItem = partItem.apply(); * g7 L. B6 D3 `; z; G+ u$ ?
if (resultItem.isError()) {
: @7 }+ n% S% }# n; e) U& z8 K top.aras.AlertError(resultItem.getErrorDetail()); + ^( h& O4 J% k3 |! v3 `
return;
: F" Z0 ~6 q# m# j" {} 7 d# R9 a" n. g* w N" L
* X" S$ o& o' W) ^ B, ]' i0 v' t
. t" X& d/ u4 i; N1 e3 l: Y2 C Q. f' } M3 o. ~3 E
8 W7 T0 I& x+ v2 R0 h: S% D: n# D
AOM方式# Q- G* {; [$ V& n6 ^; Z
) |2 n0 l' i- g' z5 R
$ f1 s ?# b7 s/ T( KJavaScript 9 d" M" p( B& A/ u e2 U" D
var innovator = new Innovator();
! N6 ?$ Z, d5 I& W( \var partItem = innovator.newItem();
6 ]- D9 d( @$ h8 F* TpartItem.loadAML( e( \+ |& \- g: k
"<Item type='Part' action='add' leaveLocked='0'>" +
3 b% w& Z6 T' G; H, T' h "<item_number>123-456</item_number>" + $ @ d' `4 B4 ~8 k
"<description>Blah blah</description>" + 0 c( M4 W0 f+ x7 |
"<Relationships>" +
$ `1 g2 \! z' D2 G5 T0 i( ^7 q! d "<Item type='Part BOM' action='add'>" + 8 ~: v! u( l# F+ ?( _* D
"<quantity>10</quantity>" +
+ W/ f6 K4 C. |3 h& b A8 H "<related_id>" +
* |7 k! v4 [0 D "<Item type='Part' action='get'>" +
7 F+ h9 `1 t6 r! ~ "<item_number>555-555</item_number>" +
2 f$ `* }/ ~- \, b9 z! L$ h "</Item>" + 6 e9 T5 r( b* K' j* s. a
"</related_id>" +
9 P3 c$ a; I( R b+ A3 O# `0 J6 i; ] "</Item>" + & M% l8 B" ?! Q* q9 D
"</Relationships>" + 4 S7 \2 y. O/ L/ a/ s. c
"</Item>" 6 ]/ D2 `' a* M5 Q* t' t' U
);
8 B$ O: ]5 A9 r4 O! `, u: k , ]8 l' Z4 z1 l/ v
var resultItem = partItem.apply();
0 O# a6 u( \5 b+ n; e: x- B7 a+ |if (resultItem.isError()) {
j$ @5 ~* _6 q2 j. d( ] top.aras.AlertError (resultItem.getErrorDetail());
: o& @8 y# Y4 S return; + W! i2 q n- K7 M
}
% R: |( k, q l/ d0 K
2 |0 f& i7 p3 f5 Q7 a! p& P |
|