BOI UPD Object - Paperless Office

SOLVED

Has anyone ever successfully created a paperless office pdf when printing/updating a Sage register/journal via BOI?  I believe the documentation says to set the journal object's 'destination' property to 'PAPERLESS'.  While I'm able to post the register, despite my repeated attempts, I'm unable to generate the pdf in paperless.  The upd object's 'print journal' method is successful with 'PAPERLESS' being specified as the destination, but no pdf in paperless viewer, no pdf in the configured pdf directory.  Would be interested to hear if anyone got this to work and/or if they knew of any special tricks that are necessary. (I actually posted about this some time ago - based on the lack of responses to that post I'm guess no one has done this, but I thought I'd throw it out there again).  Thanks.

  • 0
    SUGGESTED

    Greetings,

    Just recently we helped a Partner with a similar issue.  Here is an excerpt of some sample code that will print a specific from setting to paperless.  Requires that Paperless Office be setup for forms in Sage 100.  I have not tested this for printing journals to paperless but I expect the logic would be similar for any paperless document.

     

    taskID = oSS.nLookupTask("AR_StatementPrinting_UI")
    retVal = oSS.nSetProgram(taskID)
    Set oARStatement = oScript.NewObject("AR_StatementPrinting_rpt", oSS)
    CurrentRptSetting = "TEST"  
    retval = oARStatement.nSelectReportSetting(CurrentRptSetting)

    'Set EmailSelected property to true
    oARStatement.nEmailSelected = 1

    Set oPaperless = oARStatement.ocoPLCommon
    oPaperless.sFormPrintUISelection = "2"

    ' Set Email Engine EESilent property to true
    oARStatement.oEmailEngineObj.nEESilent = 1

    ' Set Electronic Delivery.  Third argument is the email engine object handle for the from object. 
    ' Seventh argument is set to true to force no UI when processing
    retval = oPaperless.nElectronicDelivery("",0,oARStatement.oEmailEngineObj,0, "","",1)

    retVal = oARStatement.nProcessReport("PRINT")

    Thank you,

    Kent

  • 0 in reply to Kent Mackall

    Thanks so much for this example Kent.  I'll give it a try!

  • 0 in reply to Justin K

    With Journal/Register tasks that are setup for Paperless Office, there shouldn't be too much required.

    After the LookupTask() and SetProgram() instantiate the _UPD class of the task.  There is a property PDFSilent that you want to set to a value of 1 and then just do ProcessReport( "PRINT" ).  PDFSilent will bypass the prompt to PDF if that is setup and bypass the automatic display of the PDF when printing is completed.

    Using A/R Sales Journal as an example:

    taskID = oSS.nLookupTask( "AR_SalesJournal_UI" )

    retVal = oSS.nSetProgram( taskID )

    Set oUpdate = oScript.NewObject( "AR_SalesJournal_UPD", oSS )

    oUpdate.PDFSilent = 1

    retVal = oUpdate.nProcessReport( "PRINT" )

  • 0 in reply to Steve Passmore

    Thank you as well Steve!  Hoping to give this another go shortly.  Will reply with results.

  • 0 in reply to Steve Passmore

    HI Steve,

    Thanks again for the example.  Unfortunately upon calling nProcessReport, the upd object is returning 'Unable to initialize PDF converter' (an error I'm all too familiar with).  I confirmed that my I'm able to generate the paperless PDF without issue for the same batch from the front end of Sage.  I was running my test using DCOM so thought maybe that had something to do with it, but that gave me the same result :(.  I'm going to perform every recommended resolution for this error from KB 35032 - but just wanted to see if you are aware of any other paperless office related configuration that is required in order to get this to work?  Thanks.

  • 0 in reply to Kent Mackall

    Kent, using your sample code it works perfect in foreground on Sage100c 2017 if the console is actively logged in.   However we are not able to get the code to run while in background or thru a System Scheduler, such a MS Task Scheduler.    It seems that oARStatement.nSelectReportSetting(CurrentRptSetting) fails to pick up the CurrentRptSetting = "AR_Statement" (our form name) as nProcessReport("PRINT") will produce this error - Select a template to use.        Any thoughts as to why or how to run it in background?     Thanks

  • 0 in reply to Mike Ridgeway

    Are you passing a valid report setting that the user has access to in to the SelectReportSetting method?

    Thanks,

    Kent

  • 0 in reply to Kent Mackall

    Kent, we are passing valid report settings that the user has access to.   The code runs perfectly fine when manually ran from a cmd line prompt from the Sage Server, if in an active session.   We then put in a delay of 20 seconds in the first line of code, manually run it the same way and quickly disconnect from the session, the code will produce the errors.   nProcessReport returns (Select a template to use).    It will only run for us if in an active session.       Any thought on why?    Could the AR_StatementPrinter_rpt object have a bug of short?   Will it run for you in a disconnected session?     Thanks          

  • 0 in reply to Mike Ridgeway

    Greetings,

    Yes the script to print AR Statements to paperless runs from me without the Sage 100 Launcher running.  I have this in a VBScript that I just double-click to run. Have you created and run your template in Sage 100 before trying top use it in the script?  I can get the Select a Template to use message if I run this and select a template that doesn't have a record in the SY_ReportSetting.M4T table.

    Thanks,

    Kent

  • 0 in reply to Mike Ridgeway

    Do you have a local printer object installed on the machine?  It might work when connected using a redirected printer from the session, but as soon as you disconnect that printer disappears.