Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-09-2003, 10:57 AM
mvermeulen mvermeulen is online now
Registered User
 
Join Date: 07-15-2003
Posts: 56
Send a message via Yahoo to mvermeulen
Question 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 = "<html><head></head><body><b>" + strBody + "</b></body>"
objMail.MailFormat = 0
objMail.BodyFormat = 0

objMail.Send
MsgBox "Step Five"

'Set objMail = Nothing

End Function
Reply With Quote
  #2  
Old 10-09-2003, 11:56 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,013
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.
Reply With Quote
  #3  
Old 10-09-2003, 01:26 PM
mvermeulen mvermeulen is online now
Registered User
 
Join Date: 07-15-2003
Posts: 56
Send a message via Yahoo to mvermeulen
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.

<?xml version='1.0'?> 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?
Reply With Quote
  #4  
Old 10-09-2003, 01:36 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,013
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).
Reply With Quote
  #5  
Old 10-09-2003, 01:41 PM
mvermeulen mvermeulen is online now
Registered User
 
Join Date: 07-15-2003
Posts: 56
Send a message via Yahoo to mvermeulen
Talking

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
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 08:25 AM.


Copyright © 1999-2023 Kinook Software, Inc.