|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
5 t. j$ g" B$ B! ^
/ x6 o/ h: X. ]/ D2 e C- A( ~- x" J" T3 H( ^
. H% I' l3 Y/ y+ c7 R% D& H' l& ~Technique
6 t3 d, B4 r9 e v wThere are a few ways to get an Item when you know its id and type, the simplest
4 n, }3 f M3 s8 B* ]# ]being the Innovator.getItemById() method. However, if you need to be granular about % R7 a' R# [. i1 L; m$ p8 Z
your request then building the query using the IOM is required. This provides the 5 B5 g, {- r' a) Q' s% L7 L, D
ability to include controls to limit the results and define the structure to be returned
/ P3 b1 N* E! i. x5 j4 r5 lfor the Items found.
( I9 V2 e' Q0 e8 ]; EJavaScript 5 L. V i1 p8 ~5 ~, B
var qryItem = this.newItem(myType,"get");
$ G, \4 W1 r, e+ K. c. cqryItem.setID(myId); ' v) h: g+ g6 M4 I
var results = qryItem.apply(); 7 J$ X0 N+ q% p/ [' Z+ O
+ ?; c: t6 h( j- w9 C
4 r5 d8 B$ E* ~& ?1 ], _% B
var myInnovator = this.newInnovator();
8 R7 {* P: m( s Uvar results = myInnovator.getItemById(myType, myId);
9 p$ `- E6 F/ oC#
; d5 ^/ f8 U; N |" o7 X$ L9 ]Item qryItem = this.newItem(myType,"get");
! E+ b8 d7 n5 a8 g/ q7 d6 f- E1 ]! TqryItem.setID(myId);
$ T( a# K3 v* T; H/ r/ e$ OItem results = qryItem.apply();
1 I! Z P- Z0 y% L+ U2 q+ i% D' \( C$ t% b
5 E' m: p7 f: l7 c
Innovator myInnovator = this.newInnovator();
* f% K( _/ J$ Z0 P. hItem results = myInnovator.getItemById(myType, myId); % ?( q5 t. q+ @( \! G' z# }
VB.Net + v' i6 d& S7 t, j) Z# X
Dim qryItem As Item = Me.NewItem(myType,"get")
& k1 \# |+ V. K( @6 U$ h2 DqryItem.setID(myId) 0 x* h. J( d- W
Dim results As Item = qryItem.Apply() * N" h: l% k% X$ P" r; w% V
6 k+ v0 _8 q! e& v1 O. B: G! `7 p9 w
) X1 H# f1 {. ~- A
Dim myInnovator As Innovator = Me.NewInnovator()
7 P. J7 l3 R1 u& l/ _Dim results As Item = myInnovator.GetItemById(myType, myId)
6 p) y# D/ O1 @ i8 B; Q7 T% {: `. _% R: l$ G! n
% c$ U7 w9 }( C+ p( y: N: k4 V5 V3 ~
6 U4 y" v C$ c6 J0 }9 K6 U- l3 h% z4 T4 `; u% r8 o
# d9 g( f$ F* f |
|