|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法. X6 I. @4 h6 h* z$ [
Technique
- Z# w1 t& Z2 g" k" Q$ ^Use the Innovator.applyMethod() method to apply Generic Methods. The following
; {) B5 h; a5 w& h% G4 O6 c8 ~% qexamples assume a server-side method named "Reverse String" exists, and that it % }" Z8 J9 s% C7 x- t+ C
returns a result item containing the reversed contents of the <string> tag. . O$ T% P8 S" b2 N. Z
JavaScript
% a* J& D3 A9 M4 g- U8 avar inn = this.newInnovator(); 5 p2 j5 v: y" i5 g( S
var results = inn.applyMethod("Reverse String", "<string>abc</string>"); ( |6 [& h9 O4 c
// You can also apply a generic client method but only from another client-side method 0 C- z+ x2 Y: K; y+ R* f. ^
// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); * O+ J1 l; r& r0 B' o' l# X. q; o
return results.getResult(); // returns "cba" C# 1 y1 q" A# I& A5 |
Innovator inn = this.newInnovator(); 0 u" \% ]1 Y: @3 r
Item results = inn.applyMethod("Reverse String", "<string>abc</string>"); / x9 R3 g- u% I# I" _' G. t
// Return a result item with "cba" as the contents of the Result tag
# J# l6 x( |. {return inn.newResult(results.getResult());
6 S: d) ]9 g1 fVB.Net
4 U0 Z' _& L) J! IDim inn As Innovator = Me.newInnovator() 1 S2 q- g8 j+ R" P H
Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>")
. `4 d8 [* |, T1 ?' Return a result item With "cba" As the contents of the Result tag ) y- v$ F3 z K: ]% Z
Return inn.newResult(results.getResult())
7 G! M; _3 r( @% ?5 k+ H
9 f' |" d) y5 e |
|