Error 88 (script) related to oHeaderObj.EditState

Solved

Confirmed in v2023 Premium and v2023 Standard (both 32-bit).

  • Have a SO Detail script, pre-write, that checks the status of oHeaderObj.EditState (...only wanting to run the line script for new orders).
  • Click to run an unrelated button script in SO Entry that loops through lines, making line field edits with a Write.  (Which works fine, the first time).
  • Accept or Cancel, then open another SO without closing the SO Entry panel, click to run the same button script and get the error.
  • Reopen SO Entry and it works the first time, then errors on the second.

Minimal scripts used in testing 

SO Detail pre-write:

' check the edit state of the order using oHeaderObj
if oHeaderObj.EditState <> 2 then ' not a new order
    exit Sub
end if

Button script:

' loop through lines and change something... to trigger the detail pre-write event
Set oLines = oSession.AsObject(oBusObj.Lines)
retVal = oLines.MoveFirst()
do until oLines.EoF
    retVal = oLines.SetValue("CommentText$", "Test")
    retVal = oLines.Write()
    retVal = oLines.MoveNext()
loop ' oLines

Everything works fine the first time, so I don't think the problem is something I have any control over, but if there is, hints would be appreciated.  I tried to oScript.DeactivateProcedure(*ALL*) in the button script (before the Write) but it doesn't seem to affect scripts in the oLines object.

  • +1
    verified answer

    Update: We have a possible fix that needs further testing but seems to resolve this Detail Pre-Write issue.

    The cause was found to be that the last proxy object to be loaded up into the script control (oSession, oBusObj, oScript, etc)  was getting swept by garbage collection when the table event script is activated from a button script. In this case the last proxy object loaded was the oHeaderObj object as would be the case for any Line/Detail table script.

    Kevin, Thanks again for the nice simple example to reproduce the error - it was extremely helpful in debugging this issue!

    TPETERSON, Thank you for all the detailed info! I implemented a script to access the SO_SalesOrder_bus object and create a dummy Sales Order from a button script on the P/O Entry screen to dupliate your issue, and was able to duplicate the error 88 due to the Pre-Write script from Kevin's example referencing the oHeaderObj object. I was able to confirm the fix we are testing corrected this error as well.

    Thank you
    Bret

  • 0 in reply to Bret

    That is fantastic news Bret!  Of course I'm happy to help.

    Is there a KB article?  (Big picture, I think it would be best to post status updates in the KB, vs here...).

  • 0 in reply to Bret

    Excellent news Bret.  Thank you for putting in the extra effort to see this through and I'm glad my notes were found useful.

    Is the fix contained within a few program files (i.e. SY_ScriptProxy, SY_Script, etc.) or an update to pvxocx32.dll that needs to be re-registered that could be made available that we can drop in and assist with additional testing?

    If not, just let us know what a reasonable timeline would be so that we can alert our clients.  

    Thanks again.

    Tony

  • 0 in reply to TPeterson

    Just the one file pvxocx32.dll. I have asked someone in support to create the KB and make a pre-release available.

  • 0 in reply to Bret

    That is excellent news.  Thank you

  • 0 in reply to Bret

    I haven't been able to to find the KB nor the file.  Do you have to call in to get the file?

  • 0 in reply to brc

    Yes you have to call in to obtain a pre-release of a program fix. I will check on where we are with the KB.

    Thank you.

  • 0 in reply to Bret

    Is there a status on the KB for this? I'm having a similar issue but opposite order and not a button script. On v2023 Premium PU 4 When I create a new order, I get this message. When I edit an order, then create a new order I do not get this. 

  • +1
    verified answer

    Hi Kevin,

    Sage Engineering has resolved this issue and will be included on the following releases scheduled for availability in April 2025:

    Sage 100 2025
    Sage 100 2024.2
    Sage 100 2023.5

    Note: Sage Customer Support can provide the corrected programs for either Sage 100 2023 or Sage 100 2024 with a signed Pre-Release form which may be requested by contacting Sage Customer Support at (800) 854-3415.

    This information can be found in the following published Sage Knowledgebase article:

    Solution ID 240821181239890 - Error 88 in program SY_Maint.pvc occurs when a table event script is invoked via a button script after clicking the button multiple times

  • 0 in reply to TMMeach

    This resolved an error I was having in SO Entry Error 88 which was a custom script to reset the Freight amount.