|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
6 ~% x3 D7 V' b% O7 T& x3 ? v
8 Q1 X+ v! u. {6 o
; u8 G( V6 f; D+ ~
8 Q9 a) t4 p$ {- u, |' S0 hTechnique , C k. l& d6 r
There are a few ways to get an Item when you know its id and type, the simplest - R" E3 m4 b6 Y+ t9 n8 t
being the Innovator.getItemById() method. However, if you need to be granular about 7 ]0 T) s7 E0 K: Z( Z- h; W
your request then building the query using the IOM is required. This provides the , a `4 y. r' k; G! K
ability to include controls to limit the results and define the structure to be returned ) d0 s4 V6 C, w5 d
for the Items found. ; L, h9 p! R* ]. U. g& X; q
JavaScript
' f8 x* s+ i# Cvar qryItem = this.newItem(myType,"get"); 4 Q' z, K9 k, J0 c
qryItem.setID(myId); 9 N/ Y% b ?; ^
var results = qryItem.apply(); 5 n0 i+ G) o& p8 i {4 `
$ s# w, [% s& k/ @" j) U( p" V, S& |8 b7 N: F. F$ i
var myInnovator = this.newInnovator();
/ E6 t- w* j7 ^& n0 Cvar results = myInnovator.getItemById(myType, myId);
7 L: w1 N7 n& i: J# d% ?C# , ?6 _; O* g' c+ G. N0 U! M8 O# T
Item qryItem = this.newItem(myType,"get"); ! f7 l6 f7 e0 C0 m! Z$ F& f x
qryItem.setID(myId);
" r4 [+ A7 ]. i) g# V8 Y7 sItem results = qryItem.apply();
2 x. T. }) @% y T c- V X7 S- }. ~) N. F3 S" b; D. b
9 n8 _6 U( @8 c" g
Innovator myInnovator = this.newInnovator();
; \" y Q" O) q$ @, f, Z: CItem results = myInnovator.getItemById(myType, myId);
. t R r. U4 QVB.Net
8 [0 N1 S$ w0 k' I- U0 hDim qryItem As Item = Me.NewItem(myType,"get") # g7 O1 |8 e* n+ M6 E8 M
qryItem.setID(myId)
8 M1 a7 b" E+ Y1 r1 GDim results As Item = qryItem.Apply()
# W% m: f- n( y' B9 i+ u% t
( C% t9 a7 V5 h& D6 q
8 ~. U: i7 l6 ? XDim myInnovator As Innovator = Me.NewInnovator() ! h T0 M% X- Q7 t& L* S
Dim results As Item = myInnovator.GetItemById(myType, myId)% b( p/ G9 Z$ j% Z9 l. K
# w8 m' l1 u4 h& R1 A' m
; A. m) L6 j, C" J# u* ^1 }2 B2 N0 \! J. y6 W7 D7 g# k
% O9 U8 _8 `4 O5 v
H2 Q$ `" N' E |
|