|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
7 _# l( T* E* `& A
. V$ k& R! m! @$ f! F; Y E2 q4 K, }
! e2 [- m# Y. K) `- ^1 lTechnique $ ?% A& } f) Z
There are a few ways to get an Item when you know its id and type, the simplest
8 A( l9 s4 ?" Q7 k2 T2 h7 Ubeing the Innovator.getItemById() method. However, if you need to be granular about 2 W8 r0 R( a" g
your request then building the query using the IOM is required. This provides the 4 Y" ~7 y% e8 U) b, S( G
ability to include controls to limit the results and define the structure to be returned
; k3 u4 Q, A- a3 E7 x% Dfor the Items found. + w) {+ s+ s7 }
JavaScript $ D4 Y, V# s+ L+ x$ W
var qryItem = this.newItem(myType,"get"); 7 m+ O% o" R$ P# g
qryItem.setID(myId); ' |% ?& {/ o9 d3 U( ~; {' P' M& m
var results = qryItem.apply();
; D7 o/ f0 D' i0 v; a) g6 n L0 @( s1 C+ {3 ^
4 b: q8 F. H0 r! ~* C* z
var myInnovator = this.newInnovator(); 9 T! R& U" N3 X+ R
var results = myInnovator.getItemById(myType, myId); ) R& f. k, V4 B- Q
C#
0 y2 F( Q7 I; zItem qryItem = this.newItem(myType,"get"); 2 Q c( q* Q0 h* X' Z( S
qryItem.setID(myId);
`& U1 h8 I2 {% J& hItem results = qryItem.apply(); 1 u- W5 S3 ~' I8 m( E
0 Z+ x& N3 _( J9 w) P$ S4 B; w8 P! R
Innovator myInnovator = this.newInnovator(); & _$ \, `; X% e6 |$ C9 _% b5 V
Item results = myInnovator.getItemById(myType, myId); ! i5 X% G5 b6 i$ I, u) ~, ]0 w, \
VB.Net ( F, P6 l m0 f# p/ o
Dim qryItem As Item = Me.NewItem(myType,"get")
: B9 C2 I* n% X, R: eqryItem.setID(myId) # w C9 Z R9 c% M5 O2 A3 u
Dim results As Item = qryItem.Apply()
: R+ B1 l) N. G+ [7 K
' ~3 ?" x) }( q) c. D9 {9 @# i5 ]# u6 O. q
Dim myInnovator As Innovator = Me.NewInnovator()
+ w- _) e/ p+ DDim results As Item = myInnovator.GetItemById(myType, myId)
8 w+ d0 F6 U: D# {9 w! L
: Q0 V9 A# Z% g/ E% J$ ~7 q# \0 u& { }
0 b" E+ \) K- J: P9 k# U
6 B3 m+ M: X' ^& Y. {# @% p& C
* g4 y& z. x5 ]# H* m
|
|