![]() | ![]() |
|
05-21-2010 01:40 PM
Could someone give me a very simple example of how to invoke server-side vbScript with an argument from the DoThis of an action?
Here’s a sample script that I am trying to call:
sub vbsArg(Argument)
ework.Subject = Argument
end sub
And here are a couple of failed attempts to call it:
%Script(VBScript,,%Procedure.Name,%MapName,"vbsArg
%Script(VBScript,,%Procedure.Name,%MapName,%"vbsAr
05-21-2010 04:03 PM
05-21-2010 04:10 PM
I found something what is working in my very old solution, here you have some one example:
%Script(VBScript,,%Procedure.Name,%MapName,"Functi
)
And some more simple:
%Script(VBScript,,%Procedure.Name,%MapName,"Functi
It's working for me, I hope it will help you.
05-21-2010 04:55 PM
Many thanks. I will try it right now.
05-21-2010 05:16 PM
I got problems! Here's mine:
%GRxAcct
:=%ScriptEval(VBScript,,%Procedure.Name,%MapName,"vbsEnterGRx %"%PatNameLast%",%"%PatNameFirst%",%"%PatNameMI%",%"%SSN%",%"%PatEmail%",%"%PatSex%",%"%PatDOB%",%"%Lang%",%"%PatHomeTel%",%"%PatWorkTel%",%"%PatCell%"")
And here's the Post Eval:
%ScriptEval(VBScript,,NewPatientReg,PatReg,vbsEnte
Here's the error:
Unable to execute specified script expression. Reason 'Error(-2146827286) : Syntax error, at line 1, character 12. Source: vbsEnterGRx "Smith","Jack","D","","","M","3/15/2007","EN","(55
And here's the vbs proc declaration
function vbsEnterGRx (PatNameLast,PatNameFirst,PatNameMI,SSN,PatEmail,P
05-23-2010 06:14 AM
It's quite strange.
I was trying to run your script, and it works fine if I try to run it only via %Script.
If I l was trying to use %ScriptEval, it fails.
I was searching my old solutions and there are no %ScriptEval with VBScript. I have %ScriptEval with JScript, but not with VBScript!
The quicker solution I see is creating "sub", where you will pass every variable to function and assign result to proper variable.Than run with %Script syntax this sub.
I prefer to use JScript.NET instead. Syntax is horrible, but I hope it will be a little bit quicker when I will be migrating to v9 and c#
05-23-2010 06:34 AM
EUREKA ![]()
It's quite obvious!
It's VBScript !!
The main problem is with strange VBScript syntax. If you try to execute procedure without returning value, you do it like you paste in your post. But if you try to return value, you have to add parenthesis!
Your expression should look like:
%GRxAcct
:=%ScriptEval(VBScript,,%Procedure.Name,%MapName,"vbsEnterGRx (%"%PatNameLast%",%"%PatNameFirst%",%"%PatNameMI%",%"%SSN%",%"%PatEmail%",%"%PatSex%",%"%PatDOB%",%"%Lang%",%"%PatHomeTel%",%"%PatWorkTel%",%"%PatCell%")")
I hope it will be working for you at least ![]()
![]() |
![]() |
![]() |
|
|
![]() |
![]() |
![]() |
















