|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
: B7 L7 S9 z5 F& @4 T! V
, b; P( M+ R# i. A- @
6 o1 `" B2 R, v# C9 r" |
4 B. t4 }' R. w8 x2 [7 cTechnique
% r* @* b8 a6 UThere are a few ways to get an Item when you know its id and type, the simplest
& J, l3 \6 ?6 N- m0 Gbeing the Innovator.getItemById() method. However, if you need to be granular about
1 W0 [- L9 u* ~: Fyour request then building the query using the IOM is required. This provides the ' F T; U- p# U% X% P
ability to include controls to limit the results and define the structure to be returned
3 [0 _, w+ B/ z, ^for the Items found.
: S1 P0 l) J. GJavaScript
7 W0 h( o! g9 S0 Q6 Svar qryItem = this.newItem(myType,"get"); ! O3 N& N0 B- n4 n( M+ v
qryItem.setID(myId); 5 o# S0 }9 S" C
var results = qryItem.apply();
, u* ] h9 i7 R0 H4 O ^, Z1 A k( K3 {- G; @ H' I K7 ^
3 M: X1 `: r' e( m6 z/ I1 L! f
var myInnovator = this.newInnovator(); - y+ b* ^# l0 f; Z z9 D/ t
var results = myInnovator.getItemById(myType, myId); / e2 R A0 @/ v% ] ?: h! ^( H
C# , i/ w; J* N! B n
Item qryItem = this.newItem(myType,"get"); ' d, R* m% j. x6 E
qryItem.setID(myId); : y: \9 I9 L, y V/ I( H
Item results = qryItem.apply();
' }" l% O2 h! Z. [) ^7 T* t5 z) d
1 M5 g4 D! e) N* l$ U4 e% JInnovator myInnovator = this.newInnovator(); % O3 l6 v# E- }9 D
Item results = myInnovator.getItemById(myType, myId); ; ^, G/ v& M8 Y) U. S3 M% r
VB.Net
/ v- F: d! X3 c4 N% U9 `Dim qryItem As Item = Me.NewItem(myType,"get") 5 j0 T) h- I/ C
qryItem.setID(myId)
$ \( ?, r2 {4 ? Q+ |Dim results As Item = qryItem.Apply()
7 `0 b) J9 ?1 I. y
! k+ y, e7 O4 n6 a( h1 Y) C6 Y6 g; R5 f5 {
Dim myInnovator As Innovator = Me.NewInnovator() " w6 `1 a* E5 z
Dim results As Item = myInnovator.GetItemById(myType, myId)
, S8 d2 J3 ^, X9 J, S' k
4 R1 ]9 @4 A c" |4 C& I/ f: e: \8 N- `+ w9 e
5 `# Q% Z$ _8 O' I
7 {% e3 i' S5 S" ~1 m
1 }3 O" f6 v! Y6 a3 M7 l# ~ |
|