<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

  • 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. 

Reply Children
  • 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

  • FormerMember
    FormerMember in reply to mroman

    Getting my injected preauth to work was a challenge. Not an easy interface to work with due to the protections enforced and the vault being remote.

  • in reply to FormerMember

    I opened a case with Paya and they Remote connected, tested that Paya Desktop was configure correctly and look at the script.  After seeing the error message she then said that the issues is internal with Sage and to contact Sage support.  I already have an open case with Sage and Sage's support answer was to contact Paya... never ending story.

    What I don't understand is that with Sage 2016 works fine and with Sage 2021 I am getting the error.

    Same script, same server...

    Regards,

  • in reply to mroman

    Script is working now but i am getting the following message..

    The Tax Schedule exist ..

    Any suggestions ?

    Regards,

  • in reply to mroman

    Setting a default Tax Schedule on the customer usually solves that error.

  • in reply to Kevin M

    Tried that, didn't work.

    I even hardcoded the schedule in the script and still getting the same message.

  • FormerMember
    FormerMember in reply to mroman

    You may want to try a SetValueNoValidate() on that value.

    My guess is the SPS (now Paya) CC interface isn't fully BOI compliant.

  • in reply to FormerMember

    Thanks, i'll give it a shot.

    Now, how come i can run the script on the server and not on a workstation?

    uninstalled - reinstalled Sage workstation and paya and still not working from the workstation.

    Regards,

  • FormerMember
    FormerMember in reply to mroman

    My example was run as an external script on the server as a scheduled task.

  • in reply to FormerMember

    yup, that is the way we are going to have the script running but the task on a standalone PC, then after is tested we move it to production Wich is another server not the sage server. We install Sage and Paya on this server(s) and i get the error.  It only works on the Sage server...