Sage 100

 View Only
Expand all | Collapse all

BOI GL posting issue

  • 1.  BOI GL posting issue

    Posted 10-24-2019 12:06
    Edited by Phil McIntosh 10-24-2019 14:15
    I am working on a BOI app for GL entries.  Batching is turned on for General Journal.
    Posting code:
    retVAL = oSS.nSetProgram(oSS.nLookupTask("GL_GeneralJournalUpdate_ui"), "GL_GeneralJournalUpdate_ui")
    If retVAL = 0 Then
        WriteErrorToLog(666, ("Lookup Task failed with error " + oSS.sLastErrorMsg))
    End if
    oGLPost = oPVX.NewObject("GL_GeneralJournal_upd", oSS)

    retVAL = oGLPost.nSelectBatch(Batch)
    If retVAL = 0 Then
        WriteErrorToLog(666, ("Select Batch failed with error " + oSS.sLastErrorMsg))
    Else
        If CBool(oGLPost.nProcessReport("DEFERRED")) Then
            retVAL = oGLPost.nUpdate()
            Select Case retVAL
                Case 0
                    WriteErrorToLog(666, "Posting error for Batch " + Batch + " - " + oGLPost.slasterrormsg)
                Case 1
                    WriteErrorToLog(666, "Batch " + Batch + " posted.")
            End Select
        Else
            WriteErrorToLog(666, "Journal Printing error for Batch " + Batch + " - " + oGLPost.slasterrormsg)
        End If
    End If
    If CBool(oGLPost.nProcessReport("DEFERRED")) Then
    line returns an error "Batching is not enabled for this data entry type."

    Any idea what the real issue is?
    I have tested deferred printing from the UI and it works.

    #scripting #BOI
    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    Asheville NC
    678.273.4010 ext 5
    ------------------------------
    ​​


  • 2.  RE: BOI GL posting issue

    Posted 10-25-2019 02:34
    just a few thoughts;
    Are you setting the module date to a date that is valid before getting the GL Journal Upd object?
    Are you setting the posting date of the Upd object via the SetPostingDate method and checking the retval (this should happen before calling ProcessReport)?

    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 3.  RE: BOI GL posting issue

    Posted 10-25-2019 09:12
    I had not done the SetPostingDate, but adding it in has made no difference...

    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    Asheville NC
    678.273.4010 ext 5
    ------------------------------



  • 4.  RE: BOI GL posting issue

    Posted 10-29-2019 12:08
    I've used similar code without the CBool, so maybe try without that?  I have no idea why that would matter... 

    Here's one of my snippets :

    'Update GL General Journal Register
     Set oGLJournalUpdate = oScript.NewObject("GL_GeneralJournal_upd", oSession)
    If CBool(oGLJournalUpdate.nBatchEnabled) Then
    	r = oGLJournalUpdate.nSelectBatch(strGLBatch)
    	If r = 0 Then oGLJournalUpdate("Selecting GL Update Batch " & strGLBatch)
    End If
    r = oGLJournalUpdate.nSetPostingDate(strAcctDate) 
    If r = 0 Then oGJRrrorHandling("Setting General Journal Register Date")
    r = oGLJournalUpdate.nValidatePrinter(strPrinterName)
    If r = 0 Then oGJRrrorHandling("Setting Printer to " & strPrinterName)
    r = oGLJournalUpdate.nProcessReport("DEFERRED")  ' could be "PREVIEW" or "PRINT" for hard copy, use .SelectPrinter(strPrinter)
    If r = 0 Then oGJRrrorHandling("Printing General Journal Register to \\APPS\Paperless$")
    r = oGLJournalUpdate.nUpdateInit()
    If r = 0 Then oGJRrrorHandling("Update Initing General Journal Register")
    r = oGLJournalUpdate.nUpdateMain()
    If r = 0 Then oGJRrrorHandling("Update Maining General Journal Register")
    oGLJournalUpdate.DropObject()
    Set oGLJournalUpdate = Nothing
    objFile.WriteLine "Successfully Updated GL General Journal Entry " & strSourceJournal & "-" & strJournalNo
    ​


    ------------------------------
    Steve Iwanowski, NextStep Technology Advisors, aka DSD Lancaster PA ¯\_(ツ)_/¯
    ------------------------------



  • 5.  RE: BOI GL posting issue

    Posted 10-29-2019 14:04
    @Steve Iwanowski Thanks! ​
    That got me to the real error which was ":Crystal" which probably means IT didn't install workstation setup by right clicking and run as admin...

    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    Asheville NC
    678.273.4010 ext 5
    ------------------------------



  • 6.  RE: BOI GL posting issue

    Posted 10-29-2019 14:13
    Edited by David Speck II 10-29-2019 14:15
    Any chance you are executing the script on a version of sage 100 that requires the exe.config files for Crystal Reports compatibility? Think it was version 2017+, maybe 2018+. 
    If yes, you need to copy the pvxwin32.exe.config from MAS90\Home into the directory where pvxcom.exe is located on the workstation executing the script (should be C:\Program Files (x86)\Common Files\Sage\Common Components or C:\Program Files\Common Files\Sage\Common Components) and rename it from pvxwin32.exe.config to pvxcom.exe.config.
    Also, if you are going to be dealing with paperless, make sure the [Paperless] section is copied from the sota.ini file to the sotachr.ini, sotapgm.ini, and pvx.ini files in MAS90\Launcher on the server, i don't think it is needed on the workstation in the case of advanced but i'm not positive.


    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 7.  RE: BOI GL posting issue

    Posted 10-29-2019 14:52
    I thought the pvxwin32.exe.config was only needed in the prior to 2018 versions once 2018 or 2019 were installed alongside them?

    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    Asheville NC
    678.273.4010 ext 5
    ------------------------------



  • 8.  RE: BOI GL posting issue

    Posted 10-29-2019 14:58
    Good point, not sure if it would be required for a brand new 2018+ install, i would check your MAS90\Home folder for the pvxwin32.exe.config file and if present, try copying it and renaming it.

    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 9.  RE: BOI GL posting issue

    Posted 10-29-2019 16:37
    Edited by Phil McIntosh 10-29-2019 17:11
    @David Speck II I see what you mean now.  Sage puts it in the workstation folder but they don't put it in the Common Files folder with pvxcom.exe.  Wonder how long it will take to get that installer defect fixed...​

    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    Asheville NC
    678.273.4010 ext 5
    ------------------------------



  • 10.  RE: BOI GL posting issue

    Posted 12-05-2019 12:57
    Well, this worked on the development machine but on the production server I am still getting the error 200 when posting the batch.  I have verified that every pvxcom.exe has the right .config file alongside it.

    Any other ideas?

    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    Asheville NC
    678.273.4010 ext 5
    ------------------------------



  • 11.  RE: BOI GL posting issue

    Posted 12-05-2019 13:10
    Sage City has a post from 9 years ago that suggests using DCOM as an alternative.  

    https://www.sagecity.com/support_communities/sage100_erp/f/sage-100-business-object-interface/41515/pvxcom-exe-execution

    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    "Would you tell me, please, which way I ought to go from here?"
    "That depends a good deal on where you want to get to."
    Oscar Wilde - Alice in Wonderland
    ------------------------------



  • 12.  RE: BOI GL posting issue

    Posted 12-05-2019 13:28
    When I went to post it manually today (this had not happened previously) I got printer not activated error code -30 which other posts here say is due to it taking too long to crate the PDF.  Could that be what is giving the error 200 from BOI?

    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    Asheville NC
    678.273.4010 ext 5
    ------------------------------



  • 13.  RE: BOI GL posting issue

    Posted 12-05-2019 13:57
    I have read the thread twice but do not see what version you are running?  ADV or STD.  Also it has been my experience that you have to use the v2018 pvxwin32.exe.config (NOT the v2019 version) to get it to work with v2017.  If you are running ADV, then it needs to be in the \v2017\mas90\home folder of each workstation.  If STD, then the home folder on the server.  All workstations must have the v2018 or later client installed for STD.  You can get by with installing on ADV workstations only if you have both v2108 and v2017 installed.

    Just a couple .02 of mine.

    ------------------------------
    Jeff Schwenk
    FORMER 90M Board Member
    Bottomline Software, Inc.
    Waynesboro VA
    540-221-4444
    ------------------------------



  • 14.  RE: BOI GL posting issue

    Posted 12-05-2019 15:22
    It is 2018.  The config file needs to be added for pvxcom.exe as well as pvxwin32.exe,  but in this case something else is wrong

    ------------------------------
    Phil McIntosh
    President
    Friendly Systems, Inc.
    Asheville NC
    678.273.4010 ext 5
    ------------------------------



  • 15.  RE: BOI GL posting issue

    Posted 12-05-2019 15:43
      |   view attached
    You should ask them to turn off redirected printers as a test.   See attached KB.

    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    "Would you tell me, please, which way I ought to go from here?"
    "That depends a good deal on where you want to get to."
    Oscar Wilde - Alice in Wonderland
    ------------------------------

    Attachment(s)

    pdf
    redirected printers.pdf   298 KB 1 version


  • 16.  RE: BOI GL posting issue

    Posted 12-06-2019 12:15
    Edited by David Speck II 12-06-2019 12:47
    Did you copy the [paperless[ section from MAS90\Launcher\Sota.ini to the MAS90\Home\PVX.ini file on the sage 100 server?

    Also might want to copy the [paperless[ section from MAS90\Launcher\Sota.ini to the MAS90\Launcher\PVX.ini file if it exists on the sage 100 server as well.

    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------