New Object Error 200

SOLVED

I'm receiving the error: Message=<NewObject Error: 200> Source=ProvideX.Script.1 on a new Windows 2016 server (remote desktop server).  This script was running on an older server and is still running on workstations running Windows 7.  The line referenced in the error is the very last line in the code and commented below.  Is there anything in the code that I'm not seeing that could be causing this?  

I have uninstalled and reinstalled the client.  Ran RegCom.bat.  Confirmed that the PathHome directory is correct.  I've also tried hardcoding the path to Home.

Hoping all I need is a second set of eyes and this isn't some kind of Windows 2016 with Sage 100 bug.

Thanks!

------------------------------------------------------------------------------------------------

'set today's date YYYMMDD format
sDate = Year(now) & Right(100 + Month(now), 2) & Right(100 + Day(now), 2)

'Get the ODBC path for the last accessed installation of MAS 90/200
Const HKEY_CURRENT_USER = &H80000001
'Set oReg = GetObject("winmgmts:\\.\root\default:StdRegProv")
'oReg.GetExpandedStringValue HKEY_CURRENT_USER,"Software\ODBC\ODBC.INI\SOTAMAS90","Directory",PathRoot
Set oReg=GetObject("winmgmts:\\.\root\default:StdRegProv")
oReg.GetExpandedStringValue &H80000001,"Software\ODBC\ODBC.INI\SOTAMAS90","Directory",PathRoot
'Removed registry lookup (above) as it was coming back with mapped drive format and not UNC path (below)
PathHome = PathRoot & "Home"
Set oReg = Nothing
msgbox PathHome
'Create ProvideX COM Object
Set oScript = CreateObject ("ProvideX.Script")

'The Init method must be the first method called, and requires the path to the MAS90 home directory
oScript.Init(PathHome)
msgbox PathHome

'NewObject method creates a new MAS 90 Session object and returns the objects reference in oSS
Set oSS = oScript.NewObject("SY_Session")

'The Logon method returns 1 if MAS90 Security is not enabled or if
'MAS90 has been configured to use Windows Security
retVAL = oss.nlogon()

'If the Logon method fails then you must use the SetUser method to be allowed access
If retVAL = 0 Then
'User = Trim(InputBox("Enter User Name")) 'Pompts for username
'Password = Trim(InputBox("Enter Password")) 'Prompts for password
retval = oSS.nSetUser(sUsername,sPassword)
End If

'If SetUser fails, display LastErrorMsg for reason and quit
If retVAL = 0 Then
MsgBox(oSS.sLastErrorMsg)
cleanUp(oss)
wscript.quit
End If

'Company must be configured to Allow External Access

retval = oSS.nSetCompany(sCompany)
'If SetCompany fails, display LastErrorMsg for reason and quit
If retVAL = 0 Then
MsgBox(oSS.sLastErrorMsg)
cleanup(oss)
wscript.quit
End If

' Adding SetModule call here
'The date format for the SetDate method must be YYYYMMDD
retval = oSS.nSetDate("S/O",sDate)
'If SetDate fails, display LastErrorMsg for reason and quit
If retVAL = 0 Then
MsgBox(oSS.sLastErrorMsg)
cleanup(oss)
wscript.quit
End If

' Instantiate SO business object
retVal = oSS.nSetProgram(oSS.nLookupTask("SO_Invoice_ui"))
Set oSOInvoice = oScript.NewObject("SO_Invoice_bus", oSS)  'ERROR IS ON THIS LINE

Parents
  • +1
    verified answer

    Do you have credit card processing?

    Do you have Avalara?

    Do you have any other 3rd party add-ons that may have dependencies that need to be registered/installed on the workstation running the script?

    Can you create a new instance of CI_Item_Bus if you set the program to IM_Item_UI?

    If yes, i would suspect a 3rd party add-on is interfering as there are several out there that have prerequisites in order to start SO_SalesOrder_Bus and SO_Invoice_Bus.

    If you add On Error Resume Next right before that line and change it to Set oSOInvoice = oSS.oGetObject("SO_Invoice_Bus") and then check the oSS.sLastErrorMsg property immediately after, does it give you a meaningful error description?

  • 0 in reply to David Speck

    They do have Avalara!  I was told users are doing invoicing successfully on the server, so that would indicate all Avalara components are installed, but I will check.  I'll also check the sLastErrorMsg as you suggested.  Very helpful.  Thank you!

  • 0 in reply to n0tgunshy2

    By server, do you the sage 100 server or a terminal server?

    Where are you executing the script? Is it on the same system that can access Invoice Data Entry from the sage 100 menu and process orders?

  • 0 in reply to David Speck

    Oh yea, i recall another user on this forum was able to resolve this by uninstalling and installing the sage 100 workstation several times. Are you make sure you have NTFS rights to all MAS90 parent directories above it (workstation if not Standard and server)?

    Are you make sure to the installer as administrator and running it for the first time as administrator?

  • 0 in reply to David Speck

    It is a Terminal Server.  I'll also confirm we have NTFS permissions.  I'll check that asap.  TYVM!

Reply Children