×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VBScript Automating S/O Invoice processing problem

VBScript Automating S/O Invoice processing problem

VBScript Automating S/O Invoice processing problem

(OP)
We are creating a script that will upon being fed a Batch Number will create a PDF and send it electronically to the customer using the Paperless Office functionality in Sage MAS 200 version 4.5. The process works fine doing it by hand via the UI, but we want to automate the process for our batch feed into Sage and free up our accounting staff to do other things for us.

---------------------------------------------
Set oPVX = CreateObject ("ProvideX.Script")
oPVX.Init("\\*******\mas450\MAS90\Home\")

Set oSS = oPVX.NewObject("SY_Session")

retVal = oSS.nSetUser("username", "password")
retVal = oSS.nSetCompany(Company,1)
retVal = oSS.nSetDate("S/O", aDate)
retVal = oSS.nSetModule("S/O")
retVal = oSS.nSetProgram(oSS.nLookupTask("SO_InvoicePrinting_ui"))
Set oPrint = oPVX.NewObject("SO_InvoicePrinting_rpt", oSS)

oSS.nTerminateUI()

If CBool(oPrint.nBatchEnabled) Then
retVal = oPrint.nSelectBatch(BatchNo)
If retval=0 Then
WScript.Quit
End If
Else
WScript.Quit
End If

retval = oPrint.nSelectReportSetting("PSP")

Set oPaperless = oPrint.ocoPLCommon ' Get Paperless object
oPaperless.sFormPrintUISelection = "2" ' Electronic Delivery Only in dropbox on the Form

'delay one second
WScript.Sleep 1000

' Call ProcessReport to execute the printout
retVal = oPrint.nProcessReport("PRINT")
if retVal = 0 then
WScript.Quit
end if
-----------------------------------

The problem seems to be the Electronic Delivery portion is not being fired. When we set the sFormPrintUISelection to “4” (Print/PDF All and Electronically Deliver) we get the printout, a PDF is created, but no email is generated and no errors are returned. When done via the UI, it works just fine. It’s only in the script we are having issue.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close