|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
4 O+ W+ K4 k0 h& P
3 r9 j1 x/ L" F1 O" _8 ]$ n
" x4 a( }+ F( D5 B4 B) B5 `! H5 G, d: m) |! U
Technique
$ ~# Y9 V% U* u2 ^5 B8 uThere are a few ways to get an Item when you know its id and type, the simplest
7 f6 w8 l8 ~3 s( W1 y6 J% sbeing the Innovator.getItemById() method. However, if you need to be granular about 2 D% C+ q* D ]$ E6 `
your request then building the query using the IOM is required. This provides the 9 A5 b- k8 L5 T8 P" D: ^1 C0 N" }
ability to include controls to limit the results and define the structure to be returned
1 `" V3 \0 ?6 L* c8 ]for the Items found. & i2 N) i S' T4 L) r2 s
JavaScript
* l( O) k, D% ivar qryItem = this.newItem(myType,"get");
/ k# e6 D$ s7 w- @/ d% L; uqryItem.setID(myId);
% z$ }* i" J4 M3 Q' }var results = qryItem.apply();
+ s/ T9 f3 M& t4 a
# V; J% P [/ b% B3 J1 l8 O- k4 y
( |2 R% z( K' {1 e7 N' Qvar myInnovator = this.newInnovator(); 3 r& u* r; T2 u! @& U
var results = myInnovator.getItemById(myType, myId);
$ R7 R% f! c& G6 r3 G+ zC#
8 T! T2 ^, a L) C7 }Item qryItem = this.newItem(myType,"get"); 8 @8 a2 X9 Z( K8 c; C
qryItem.setID(myId); & r# v0 a1 j4 |& z
Item results = qryItem.apply(); . p# R9 x# _" a5 k k) V
3 u0 o7 u: w( G/ t3 o2 X' V. x& J h6 g8 `2 S( K, f3 D7 ]. d
Innovator myInnovator = this.newInnovator(); : |6 k$ r- l: {" s
Item results = myInnovator.getItemById(myType, myId); ! H% I3 n- J. }& L" N1 L; I! ^' m( H
VB.Net
( K! y) u& J# k# O/ E6 lDim qryItem As Item = Me.NewItem(myType,"get")
; n; F/ U: y: W0 R0 y! y7 q6 bqryItem.setID(myId) 7 Q9 x/ ]; D# ]$ V# v
Dim results As Item = qryItem.Apply() + D+ z6 c; x7 z" M# a: f( s
, |% Y# J3 q2 j- T v* {, Z
$ v4 _. t& l& _' }9 h P8 XDim myInnovator As Innovator = Me.NewInnovator() # @, k* S- y+ ]2 k6 R. k% m
Dim results As Item = myInnovator.GetItemById(myType, myId)! ^: }! a. i1 V, u. @
: C( Z% A6 s: k5 G) c, D( H4 Y
$ B9 F5 I4 ]$ Y; e+ w
: b& A% I: U/ F% L) K/ a3 E9 y E
6 d- G7 G$ g& f5 {
+ C6 |+ [* f* C/ \7 D5 s |
|