Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Unspecified Error (https://www.kinook.com/Forum/showthread.php?t=211)

mvermeulen 10-09-2003 10:57 AM

Unspecified Error
 
I am receiving the following error:

Error loading info for custom action 'Run Script': Unspecified error

The step generates a fail message but actually completes. I have written a script that I have reduced down to try and locate any possible errors. It almost seems to be dependent on the lenght of the script. As I have backed out more of the comments and additional check functions (IF Exists for example), I progressed further. Since it is actually sending the e-mail (somewhat ugly at this point), I am hoping to isolate the error.

Function vbld_SendMail()

Dim objMail
Dim strSubject
Dim strBody
Dim strToAddr
Dim strFromAddr
Dim logFile

' determine the log filename, retrieve with all macros/script expanded
logFile = Application.ExpandMacrosAndScript("%LOGFILE%")
strToAddr = "Mark.Vermeulen@cbs.fiserv.com"
strFromAddr = "test@cbs.fiserv.com"
strSubject = "This is a test email in HTML format"
strBody = vbld_FSO.OpenTextFile(logFile).ReadAll()
MsgBox strBody

' First create an instance of the NewMail Object
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From = strFromAddr
objMail.To = strToAddr
objMail.Subject = strSubject
objMail.Body = "" + strBody + ""
objMail.MailFormat = 0
objMail.BodyFormat = 0

objMail.Send
MsgBox "Step Five"

'Set objMail = Nothing

End Function

kinook 10-09-2003 11:56 AM

Try turning off 'Tools | Application Options | Logging | Log default property of each step'. There may be a problem with that functionality when the value of the default property (the script code field in the case of a Run Script action) is beyond a certain length.

Alternatively, move your script function(s) into project or global scripts (in the Script Editor) and only include the call to it in your Run Script action, to reduce the length of the code in the step's default property.

mvermeulen 10-09-2003 01:26 PM

I removed the log defaults from the options and now it fails completely.

Error at Line 1, Column 1 (Type mismatch: 'vbld_SendMail()')
10/9/2003 2:21:50 PM: Step 'Send HTML EMail' failed
10/9/2003 2:21:50 PM: Build ended.

The script code that is in the step calls the function as below.
[vbld_SendMail()]

It is also current a Project script. Nothing else about the script itself has changed.

The output I received in the initial e-mail is as follows.

D:\Builds\GPD31\Scripts\Logging.bld Send HTML EMail

The test is a very simple one just to try and get the steps to work properly. Any other ideas?

kinook 10-09-2003 01:36 PM

You're actually getting farther this time, it just may not seem like it. The step is building, but you're now getting a runtime error when the script code gets executed. Two problems that I see:

1) If this code is in the Script code field of a Run Script action, you should remove the bracket [ ] chars (brackets are used in other step fields to indicate a script expression to be evaluated).

2) VBScript syntax requires that you not use parentheses around a function call unless a) you're passing the result to another function or b) you prefix it with the line with Call.

So simpifying your expression to

vbld_SendMail

should get you farther along (it should then actually make it into your function).

mvermeulen 10-09-2003 01:41 PM

Outstanding!

Is most of this information in the help documentation? Some of the examples are very good but they of course can't cover everything.

Thanks for you help!

Mark


All times are GMT -5. The time now is 12:13 AM.


Copyright © 1999-2023 Kinook Software, Inc.