|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
3 S0 c% w( }" l/ D4 Q) T o! V# e8 y
D0 O1 ^* W6 n' I% R7 H. E: }1 }7 T. m/ u: h
* ], {" s3 _2 C* w, YTechnique * b d& i2 q8 l0 O- C+ W/ u3 W
There are a few ways to get an Item when you know its id and type, the simplest
8 z: m8 j" u/ q& H. o& @# jbeing the Innovator.getItemById() method. However, if you need to be granular about
5 {' O7 _* Q+ |4 ayour request then building the query using the IOM is required. This provides the
) w% i- f& ~+ Y8 ?ability to include controls to limit the results and define the structure to be returned
; z; ~- @/ G( m% Wfor the Items found.
, {3 T/ ~" g3 s& }! m" \' fJavaScript
, ]8 @. n5 T/ @' d+ o4 t7 w- Wvar qryItem = this.newItem(myType,"get");
8 |1 b: l1 H' q# F" z) a/ rqryItem.setID(myId);
) a/ Y) Y9 Q2 m- j8 @$ w$ b* j' dvar results = qryItem.apply();
s7 r1 Y1 J# o) B2 H$ O8 q0 O" j& l
) m* k4 O4 O) ]- y9 _& m$ t- q) W% w) Q! H5 `. B( P) P6 ] }+ e" P
var myInnovator = this.newInnovator();
5 @' V# g$ A2 gvar results = myInnovator.getItemById(myType, myId); 3 D P# |4 m4 D& A6 A
C# " ]4 w" ^0 K1 |4 K" D1 ^
Item qryItem = this.newItem(myType,"get"); 9 `6 x6 u3 y4 b7 j
qryItem.setID(myId);
4 O# b ?: ]' T1 C/ | C q4 ~Item results = qryItem.apply();
# i. k& K2 V0 ~: q/ v+ q* b# [$ }1 P" X8 b* K$ E
s- S% N2 W9 x
Innovator myInnovator = this.newInnovator(); Y5 }. x2 m9 O* U3 S
Item results = myInnovator.getItemById(myType, myId); % R4 C+ ~" z& h
VB.Net
) k. ]( a. o) N$ S1 F/ A7 ]Dim qryItem As Item = Me.NewItem(myType,"get")
( P4 O. B& z3 U( ?; f- B0 C& xqryItem.setID(myId) 6 b; A# L1 J% E3 J" s0 t" ^
Dim results As Item = qryItem.Apply()
X* J% `" Z! v1 C8 [9 M: \1 X
5 R6 n; ?5 f" `; B5 \0 ] g
2 o: C; ^* u4 QDim myInnovator As Innovator = Me.NewInnovator()
1 I9 ?) j9 @ B2 y, V$ a3 PDim results As Item = myInnovator.GetItemById(myType, myId)
! z- L9 C( x+ A" l
0 R# F3 e, P) ]8 Z1 n" f* o# ^: `9 v/ p- l9 N
% P& \! v7 S: Y, c. ~4 B# D3 w& Y6 i$ \7 d1 [) v+ x# O
" H y, I% }/ L, }& q. r$ r* _; R |
|