<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

  • 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

  • in reply to Bret

    Thank you very much Bret...

    This is very helpful, always blamed PAYA but i couldn't prove it.

    Regards,

    Manuel

  • FormerMember
    FormerMember in reply to mroman

    If you are doing after the fact transaction posting and the CC preauth done elsewhere skipping the SPS vault and CC storage you need to take a creative approach.

  • in reply to FormerMember

    Thanks for the help, John. 

  • in reply to mroman

    So far i cannot get passed the error.. this same script was working fine in Sage 100 2016.

    After the upgrade to Sage 100 2021.2 is when we start getting this error.  I am quite sure something changed on the object but i'd like to know what.

    Is it Paya the issue? maybe TLS 1.2 needs to be registered?

    Any suggestion will be greatly appreciated!!

    Regards,

    Manuel

  • in reply to Bret

    Hi Bret,

    Do you have an idea on where I can research on this issue with CC's.

    Working on Sage 100 2016 but not working on Sage 100 2021.2,  I did a test on 2016 and works fine, no issues.

    Regards,

    Manuel