|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
1 l* o. t7 f; m* m# H
5 g1 w" p" u: ~, R9 U B& }9 M0 }$ H/ D) [# ?
$ g$ y- S+ _" k5 K0 a5 ]4 n
Technique
, @( K3 w( _7 N/ r% t; L6 eThere are a few ways to get an Item when you know its id and type, the simplest
9 e4 [( p& e$ S/ [; a1 @/ \8 O3 ?being the Innovator.getItemById() method. However, if you need to be granular about
1 V$ g- h9 J7 ]5 u" H3 Lyour request then building the query using the IOM is required. This provides the
* k7 z% e2 J) M. o3 ]3 cability to include controls to limit the results and define the structure to be returned
/ B. Y! ]2 {1 M2 B0 |6 Dfor the Items found. ?% X" i" }0 L& r0 C' p
JavaScript " D4 Z; \* g3 m7 U
var qryItem = this.newItem(myType,"get"); & G4 S1 Q0 f1 L4 n2 D
qryItem.setID(myId); w2 @% U# o: Z; P' R4 U
var results = qryItem.apply();
+ R4 q" O3 m, Z1 r7 W8 s, d& [
7 x2 E! f% q# D/ ]
0 g/ \6 R( e0 q" Jvar myInnovator = this.newInnovator();
/ E7 W' \) O, ]# kvar results = myInnovator.getItemById(myType, myId);
* z, F/ j. C2 @* E" i+ AC# 1 F5 g( D; _! v. N9 x
Item qryItem = this.newItem(myType,"get");
4 k/ S/ F- o, Y8 B5 eqryItem.setID(myId);
* p8 q) Z& m1 I9 Z) P$ E1 eItem results = qryItem.apply();
5 ~( m" C& X& L( F, V9 ?& d! |1 ^5 B) i; S' s: y
& y, x/ C, b* v+ `5 l6 iInnovator myInnovator = this.newInnovator();
" l: l$ N) z- p; v0 e, w* hItem results = myInnovator.getItemById(myType, myId); 9 ~* Q1 H8 a A/ N" n" ^5 y+ i
VB.Net $ ^' }( |* D8 y0 T4 N
Dim qryItem As Item = Me.NewItem(myType,"get")
" o/ S% |( c$ ?, l, ?" `8 RqryItem.setID(myId)
) i. H0 x, _/ o) ^Dim results As Item = qryItem.Apply()
& P' [) z# Y! y6 K. X5 y
6 C0 m1 ^' U6 ? M- Y+ r, u- S# ?$ t3 C2 z# r
Dim myInnovator As Innovator = Me.NewInnovator()
0 k8 [5 i4 K) H) t* c# k' `4 ]" gDim results As Item = myInnovator.GetItemById(myType, myId)
! ^' p# s3 M4 D3 T
0 u( |5 l- s% C' a. {7 A4 I$ L
4 [) D2 `" \. y. ] x0 Z! V
# A6 }* V" i) j1 H$ G& K- T! v \( k
1 y+ ]- G7 i! d: Z/ U. x. c3 }# u
|
|