|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
0 q- A1 t, f' F: R+ V
; A8 D9 P* \" A( u5 O! c N4 K; z4 u: i- ^, N3 o
$ v4 X8 w; h2 X8 u/ f* HTechnique 1 U* l; w# Y I* d' K
There are a few ways to get an Item when you know its id and type, the simplest
) B/ }0 w5 R) n" y2 s7 Hbeing the Innovator.getItemById() method. However, if you need to be granular about 3 v7 n* \' K* a6 b& N
your request then building the query using the IOM is required. This provides the - I; I! Z6 c4 f) {
ability to include controls to limit the results and define the structure to be returned
8 |5 a) P$ J7 Z, A- B% wfor the Items found.
. j( _8 w+ K! z4 VJavaScript 0 ?" @; q# X0 C9 R% O: `
var qryItem = this.newItem(myType,"get");
) ?$ u& u: T, g& WqryItem.setID(myId); ! J2 I- q, \/ `; p, J' a$ n
var results = qryItem.apply(); & M6 r# P8 r/ t( w+ {
2 i& k l0 {6 s& `& R7 U7 I
$ T; F/ \5 B+ {% a0 O; t; H1 bvar myInnovator = this.newInnovator();
# s- p5 p* A1 I: ^" w" m Y- @' Y1 u$ Tvar results = myInnovator.getItemById(myType, myId); ! x- n# g, [( n, f
C#
S8 k/ ~, e' i5 e' Q m/ E( lItem qryItem = this.newItem(myType,"get"); 8 B R4 l% \' X3 o4 W& `
qryItem.setID(myId);
6 l! |" Q) }) i' _' z& `Item results = qryItem.apply();
; s* q4 K+ F; u! w- ]* A. a% z# S' p% S
; Y6 K G: K6 _Innovator myInnovator = this.newInnovator();
2 _, ~( o& @' X. y/ pItem results = myInnovator.getItemById(myType, myId); 5 S% Z a) e, ^) l
VB.Net 7 |7 B% n) W; S( [
Dim qryItem As Item = Me.NewItem(myType,"get")
4 m; [* W9 A1 D* x- T# X- `: F2 ]qryItem.setID(myId) * ^5 y' ] K8 y9 H" ~6 M1 W5 E- z# p# L- H
Dim results As Item = qryItem.Apply()
; m) \5 f9 L4 h. @4 {! _7 ]0 C/ H* T+ G
# u3 b3 k8 m, U! q8 u
Dim myInnovator As Innovator = Me.NewInnovator() # X# }8 G5 g/ w6 U- c
Dim results As Item = myInnovator.GetItemById(myType, myId)& w' \+ b5 c& E. F- Z, z. [' M
0 N& a4 S0 E( Y
9 Q9 l: }. X) a: i1 x2 Y7 W
% Y4 G% _1 Q% ~7 z2 {8 h
" B0 J7 y- Y: H: I8 [6 J
! A# [) W: A- I, @5 i |
|