In Sage 100 2023, why does the HandleScriptUI method now get Error #88 after InvokeButton?

SOLVED

To reproduce, in either 32-Bit or 64-Bit Sage 100, create an "Execute Script on Server" button in either Customer Maintenance or Item Maintenance (maybe any panel) that runs a simple two line script:

retVal = oScript.InvokeButton("BT_LINK_2")
retVal = oUIObj.HandleScriptUI() 

Where the target button (BT_LINK_2) runs another script with any valid statement (MsgBox "Hello World" 'works) and the result will be an Error #88 and the MsgBox is not invoked. This worked in 2022 and 2021

Parents
  • 0

    We are seeing similar behavior on any subsequent script execution that is triggered from a button script in 2023.

    One of our largest clients is attempting to migrate to Sage 100 2023 Premium with SQL 2019 and Windows 2022 servers.

    As a simple example, we have a button script on the Purchase Order Entry panel that runs a server side script to create a somewhat matching Sales Order using the SO_SalesOrder_bus object. 

    If there are no business object scripts on the Sales Order Detail table, the new sales order gets created fine; however, there are several scripts that need run on this table during pre and post validate events of several fields on the Sales Order detail object.  We've stripped all of them down to one simple Post Validate script that runs on the ItemCode that simply sets one field value via oBusObj.SetValue.

    When creating a sales order natively in the sales order entry screen, that script runs fine.  If we trigger the PO button script to create a sales order via the SO_SalesOrder_bus object, it throws an Error 88 in SY_Maint at line 3556 when the ItemCode Post-validate event is triggered from the newly created sales order object in the button script.

    We've traced the issue to the InitScriptEngine method when attempting to set the AllowUI property on the coScriptHandleVB object.  This property is a standard property for the MSScriptControl.ScriptControl system object from Windows, but for some reason is not a valid property on the proxy pvx object in memory when the InitScriptEngine method is called within SY_Maint (specifically line 3556)

    This is a serious technical problem as the majority of our clients have multiple pre and post script events in place all of which fail if an entry is being created from a secondary screen via a button script.

Reply
  • 0

    We are seeing similar behavior on any subsequent script execution that is triggered from a button script in 2023.

    One of our largest clients is attempting to migrate to Sage 100 2023 Premium with SQL 2019 and Windows 2022 servers.

    As a simple example, we have a button script on the Purchase Order Entry panel that runs a server side script to create a somewhat matching Sales Order using the SO_SalesOrder_bus object. 

    If there are no business object scripts on the Sales Order Detail table, the new sales order gets created fine; however, there are several scripts that need run on this table during pre and post validate events of several fields on the Sales Order detail object.  We've stripped all of them down to one simple Post Validate script that runs on the ItemCode that simply sets one field value via oBusObj.SetValue.

    When creating a sales order natively in the sales order entry screen, that script runs fine.  If we trigger the PO button script to create a sales order via the SO_SalesOrder_bus object, it throws an Error 88 in SY_Maint at line 3556 when the ItemCode Post-validate event is triggered from the newly created sales order object in the button script.

    We've traced the issue to the InitScriptEngine method when attempting to set the AllowUI property on the coScriptHandleVB object.  This property is a standard property for the MSScriptControl.ScriptControl system object from Windows, but for some reason is not a valid property on the proxy pvx object in memory when the InitScriptEngine method is called within SY_Maint (specifically line 3556)

    This is a serious technical problem as the majority of our clients have multiple pre and post script events in place all of which fail if an entry is being created from a secondary screen via a button script.

Children