<NewObject Error 200> on Set oCC = oScript.NewObject("AR_CustomerCreditCard_bus", oSS)

Hi Forum,

We are getting an error 200 trying to create "AR_CustomerCrditCard_bus" object

The customer uses Paya to pre-auth credit cards and for whatever reason it is not letting us create the object.

This same code worked in Sage 2016.  Upgrade the customer to 2021.2 Premium and the code stopped working.

Any suggestion 

Regards

Parents
  • Is the above just a typo?  The object you are looking for is "AR_CustomerCreditCard_bus"

  • in reply to jepritch

    Yes, it is a typo... sorry.

    Set oCC = oScript.NewObject("AR_CustomerCreditCard_bus", oSS)

  • in reply to mroman

    The code is

    Set oScript = CreateObject ("ProvideX.Script", "SAGE")
    oScript.Init("\\Sage\acctg\Version 2021\Sage 100 Premium\MAS90\Home")
    Set oSS = oScript.NewObject("SY_Session")
    r = oSS.nLogon()
    If r=0 Then
    r = oss.nSetUser("kuser","K2022!")
    End If
    r = oss.nsetcompany("RAT")

    r = oSS.nSetDate("S/O", "20220316")
    r = oSS.nSetModule("S/O")
    oSEC = oSS.nSetProgram(oSS.nLookupTask("SO_SalesOrder_ui"))
    Set o = oScript.NewObject("SO_SalesOrder_bus", oSS)
    oSEC = oSS.nSetProgram(oSS.nLookupTask("AR_Customer_ui"))
    Set oCust = oScript.NewObject("AR_Customer_bus", oSS)
    'Set oCust = oScript.NewObject("AR_Customer_svc", oSS)
    Set oCC = oScript.NewObject("AR_CustomerCreditCard_bus", oSS)
    Set oPayment = oScript.NewObject("AR_PaymentType_svc", oSS)'
    Set oSOPayment = oScript.NewObject("SO_SalesOrderPayment_Bus", oSS)

    I've been playing with it with no luck

    Regards

  • FormerMember
    FormerMember in reply to mroman

    I recently did a Sales Order preauth payment record create and posted the ScriptBasic code here on Sage City. The transaction was created on the e-commerce site and a Sales Order and payment record had to be created in 100 to ship and invoice. To make it worse, the client previously had e-commerce interface that include M/D mods to to code and credit card file structure. I ended up having to do a ProvideX PERFORM to create the AR_CustomerCreditCard record. The credit card interface in 100 isn't for the casual coder.

    The SO_SalesOrderPayment object is a child of the SO_SalesOrder object and shouldn't be accessed directly.

  • in reply to mroman

    Hi Manuel, just a tip for debugging new object error 200's in vbscript...

    Try disabling the vbscript error handler then query the LastErrorMsg in the session object like this:

    
    On Error Resume Next
    Set oCC = oScript.NewObject("AR_CustomerCreditCard_bus", oSS)
    On Error GoTo 0
    
    MsgBox "Err: " & oSS.sLastErrorMsg
    
    


    When I test your code on my machine I too get an error 200 and the session error indicates that the Paya desktop needs to be installed/running:



    Hope that helps!
    Bret

Reply
  • in reply to mroman

    Hi Manuel, just a tip for debugging new object error 200's in vbscript...

    Try disabling the vbscript error handler then query the LastErrorMsg in the session object like this:

    
    On Error Resume Next
    Set oCC = oScript.NewObject("AR_CustomerCreditCard_bus", oSS)
    On Error GoTo 0
    
    MsgBox "Err: " & oSS.sLastErrorMsg
    
    


    When I test your code on my machine I too get an error 200 and the session error indicates that the Paya desktop needs to be installed/running:



    Hope that helps!
    Bret

Children