|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
# o. z( Q8 O& R' `; N. A
3 Z1 \1 e# v) e! ]) c+ S% v/ @3 b& ^/ L5 v0 J; w
, ?9 F6 l! I8 q* I, R; oTechnique 8 m4 b/ ^' P' I, ?, j! f- x- a! [- V
There are a few ways to get an Item when you know its id and type, the simplest 9 ]" {2 ~- x3 N I( b# k
being the Innovator.getItemById() method. However, if you need to be granular about 5 r# [4 Z7 M7 J6 f
your request then building the query using the IOM is required. This provides the
( o- V/ x( v% v: d! R' mability to include controls to limit the results and define the structure to be returned % l: P! s: k4 ]' l1 T$ A( f/ L
for the Items found.
& Q% A. S1 P GJavaScript . @& q7 F! S/ w2 ]8 i+ x
var qryItem = this.newItem(myType,"get"); " N" k8 x) y* e2 j9 V$ c2 R
qryItem.setID(myId);
( K% G+ r4 m: w# N, Z# mvar results = qryItem.apply();
! t/ p5 I0 S9 z! V! `0 V/ [7 v% d4 V" g* x9 a4 A+ t: Q
6 S/ v s5 a& h& r9 p0 Zvar myInnovator = this.newInnovator();
, Q* B% _3 L3 I7 h; Xvar results = myInnovator.getItemById(myType, myId); O0 d: \% ]- Y( Q/ V9 W4 m
C#
x) B8 v2 K& F. q S4 |- sItem qryItem = this.newItem(myType,"get"); " ` N2 c, j# @9 D/ p
qryItem.setID(myId);
* A/ n, l) O* O3 i, cItem results = qryItem.apply(); / W# h: n7 H/ s7 Z3 `# w9 m
; Q* C2 J! Z/ _" g! ^1 V: c" _
5 N3 B$ j# o3 V
Innovator myInnovator = this.newInnovator();
1 Y4 B7 S8 v! O& f2 S7 gItem results = myInnovator.getItemById(myType, myId);
2 b/ A) _# w) F8 U+ X5 VVB.Net * a" t6 k# l; v' ?0 D
Dim qryItem As Item = Me.NewItem(myType,"get")
2 l* C5 V7 ?$ R- q, ^3 T9 yqryItem.setID(myId)
/ Z4 U O5 X( L# W GDim results As Item = qryItem.Apply() . C9 `' ?3 ?! N
( F0 C9 p9 N% o
/ c, R' n# f5 [" o' _; xDim myInnovator As Innovator = Me.NewInnovator()
2 J6 D: W2 J8 L; E' gDim results As Item = myInnovator.GetItemById(myType, myId)! M- G* Y! F, }9 k2 ]8 B6 ?
3 @/ a" F9 f8 [6 e' t8 c) u7 y1 d, a$ n
+ X3 o, Q) H- v: Y4 w0 w
' ^! t4 [8 g0 t7 r- ?; a) |4 |" m
|
|