|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
, C; h1 U8 ^: V6 n! t6 O
8 X; s+ }4 z) O3 N2 w3 Z7 b# c3 Q% Q: {) z
+ l3 v: P& Q0 y/ h% H7 E! s
Technique
" _! D" R9 n3 zThere are a few ways to get an Item when you know its id and type, the simplest 7 {4 g& X( U% ?! p
being the Innovator.getItemById() method. However, if you need to be granular about
1 `% J8 t' W; F/ c6 X) l. ayour request then building the query using the IOM is required. This provides the # }* x8 x1 H4 [9 @9 u
ability to include controls to limit the results and define the structure to be returned ( z/ X" J5 A4 _8 x5 k
for the Items found.
3 K3 U2 d6 ?3 A* l* g ^JavaScript * M8 W. M" h2 q5 [. ~' H H0 m
var qryItem = this.newItem(myType,"get");
7 e+ z* T( l" g$ YqryItem.setID(myId); X; J; I8 E9 h' {: X9 \7 ~
var results = qryItem.apply();
& v2 N4 b+ f8 e' g. {" a& Z$ [0 ~% U9 w/ v' t8 F
$ V% k" q( V5 \0 J. l2 g, H6 W7 avar myInnovator = this.newInnovator(); * G7 r [. q0 n, ?; \
var results = myInnovator.getItemById(myType, myId); ' F/ r6 y7 x' A8 s( q( ?
C# ' f, G) B# ~) s4 |2 B
Item qryItem = this.newItem(myType,"get"); 6 I4 o( w; w: h1 Q+ t6 J8 T! n
qryItem.setID(myId); & T( a x: {" T- O" W/ R
Item results = qryItem.apply(); / r# D+ `5 u7 z, M7 Y
3 [8 `6 J* f0 U9 [! g; D* q% \0 p. C" f s* m
Innovator myInnovator = this.newInnovator();
4 K( I0 q r( G# bItem results = myInnovator.getItemById(myType, myId);
# h+ O4 A: `$ GVB.Net 9 V$ d6 y: ?' g' P/ p. l! Z2 B
Dim qryItem As Item = Me.NewItem(myType,"get") : m% t. | _ }! F3 j
qryItem.setID(myId) : B% P2 I+ `8 P) q* p
Dim results As Item = qryItem.Apply() 6 s! p Z p/ A
+ _9 A* X1 A4 A c K
- p; |* j3 q' q# e5 MDim myInnovator As Innovator = Me.NewInnovator() + [$ m5 Q% R" O* S+ d& _% F
Dim results As Item = myInnovator.GetItemById(myType, myId); V7 d, |( Q9 i# H9 o# K, t$ P
/ N- ~1 R, N7 t: N0 p
5 X) P. B; \" O. g g4 S% y7 p
2 W! R& j+ P7 Q/ L: [' _/ s! \( ]
5 i( ~# T% |5 C! Z# _% [5 u( w
|
|