Sage 100

 View Only
  • 1.  SO Invoice data entry lockup due to .MessageBox

    Posted 08-10-2020 11:21
    We have a script on a button that loops thru the invoice lines and zeroes out the back-order quantity (100-200 line order just easier).  At the end the button script throws up a .MessageBox("","Clear backorders complete").  When a user clicks it the message box appears as it's supposed to, click OK, go back to the lines tab and the whole screen locks up.  This is Sage 100 Advanced 2015 with Scanco multbin.  The script itself has been in place for years, but the message box we just added recently so they would have a verification it was done, minor request, and upon adding that message box everything went off the rails.  

    Tried
    sMsg="Clear backorders complete")
    retMsg = oSesasion.AsObject(oSession.UI).MessageBox("",sMsg)

    Tried

    Set oUI = oSession.AsObject(oSession.UI)
    retMsg = oUI.MessageBox(".","Clear backorders complete")

    didn't really seem to matter, the whole screen would just freeze after switching back to the lines tab or really any other tab.

    I'm hoping someone has seen this before as I'm at a loss, we add message boxes all the time and never have i seen it lock a screen up....



    ------------------------------
    Chris Mengerink
    Director
    DWD Technology Group
    Fort Wayne IN
    260-399-8653
    ------------------------------


  • 2.  RE: SO Invoice data entry lockup due to .MessageBox

    Posted 08-10-2020 11:52
    Small point is the 2nd MessageBox for the 1st argument has a "." in it which is not a valid MessageID from the Message Library (usually not used in scripting anyway) but should end up getting ignored and should not lock up. Seems more like a timing issue of when your MessageBox executes or maybe you are trying to Set oUI = Nothing afterwards.

    Hard to say but as an alternate have you considered using ProgressBar? Something like this:

    If oSession.UI<>0 Then Set oUI = oSession.AsObject(oSession.UI)
    'init the progress meter
    rV = oUI.ProgressBar("init", "Zeroing out Backorder Lines...", "Zero out...", 0)
    'within your loop, issue this every X line records. Start with X=10 and adjust up or down as needed.
    'nCounter assumed to be a line record counter you're incrementing
    If nCounter Mod X = 0 Then
    rV = oUI.ProgressBar("update")
    End If

    'at the end where you clean-up, close the progress meter
    rV = oUI.ProgressBar("close")


    ------------------------------
    Alnoor Cassim

    Accounting Systems, Inc. (ASI)
    Email: alnoor@asifocus.com
    Orange County, CA
    ------------------------------



  • 3.  RE: SO Invoice data entry lockup due to .MessageBox

    Posted 08-10-2020 11:56
    Thanks Alnoor, I will try this progress bar, that would be a good alternative and I'm looping thru the lines so a great place to do it!!

    ------------------------------
    Chris Mengerink
    Director
    DWD Technology Group
    Fort Wayne IN
    260-399-8653
    ------------------------------