|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
7 e" f; W- g9 D! ~1 u' Y
, J/ ]4 n& @9 p: U, F
; b1 Y# `# S+ ^6 Y$ F E
, }! t! T( o d" [% ~( PTechnique
- C$ F8 S+ g) c# cThere are a few ways to get an Item when you know its id and type, the simplest
* ~! k, x+ V( A; b7 V5 D6 R4 ibeing the Innovator.getItemById() method. However, if you need to be granular about . {: O8 B2 K+ w5 F) e5 @4 r
your request then building the query using the IOM is required. This provides the
2 \' c2 ^8 |& L5 O. q/ sability to include controls to limit the results and define the structure to be returned
* {$ k! t8 {: X, j& g- K' Y: Ffor the Items found. $ x$ V4 `+ d) E5 E3 U
JavaScript
+ G. e9 b" \+ {6 I, Nvar qryItem = this.newItem(myType,"get");
$ E0 ~9 f1 |0 H/ |$ f4 M5 qqryItem.setID(myId);
: k0 a7 \- |1 Svar results = qryItem.apply(); . y2 O! [# B- ~3 e
2 w3 N, x/ r+ n5 [3 u
7 H! ?! a2 C! E. a j( y7 b0 E( wvar myInnovator = this.newInnovator(); 8 n7 p! J2 A; G$ M
var results = myInnovator.getItemById(myType, myId);
& x, G* j0 G6 U2 PC# ' i U2 |% }' b0 x1 ^6 q
Item qryItem = this.newItem(myType,"get"); - \4 K# |3 X; ]8 k) y3 Y
qryItem.setID(myId); 8 c, W0 l& S+ Y, [
Item results = qryItem.apply(); v8 ^) C1 s$ d$ ]! W+ H# n$ k5 T: c
8 K, l$ v2 C& ~1 g3 V( h. j! K6 [ A
8 z) e- h1 J6 T& S- R& u [Innovator myInnovator = this.newInnovator(); 2 g# ]( x' x3 h8 l- o6 r
Item results = myInnovator.getItemById(myType, myId); / z& X- w! i. z: b( t* @
VB.Net - J" H( v, R- o$ ?: J, y9 h( T
Dim qryItem As Item = Me.NewItem(myType,"get")
. [" e' b8 d$ Q* m" `7 P) a2 JqryItem.setID(myId) ! c1 F+ V9 g7 f+ L0 y R) Y, \! B% c
Dim results As Item = qryItem.Apply() _0 |0 P$ N: a+ Z9 n1 v
' o* d1 ]+ W6 U' i2 s+ \5 K9 E
3 n5 p+ M- V( r7 E3 KDim myInnovator As Innovator = Me.NewInnovator()
# f5 L N/ H8 @1 r7 ~& L7 A( l! |, a5 CDim results As Item = myInnovator.GetItemById(myType, myId)
v( Z% \3 t. [2 K7 U; c7 J0 A2 Y9 S3 w. `* b- G6 U
8 _7 k# C7 X" n8 G1 f( L5 @
+ R* S4 U) N/ r) A
2 [' x+ V3 T" r9 V7 H+ U
3 ]: w, P0 N# }* l4 H |
|