Is AP_VendorElectronicPayment_bus available through BOI?

SUGGESTED

I am having trouble trying to create a new record using BOI for AP_VendorElectronicPayment.  It is in the Object Reference, but I get a 200 error when I attempt to instantiate it.  I have it typed correctly, and the user account I am using has access to it.  We are on Sage 100 Advanced ERP 2014.

  • 0

    Also, I am using AP_VendorElectronicPayment_bus.

    Set oScript = CreateObject("Providex.Script")
    oScript.Init("\\server\Sage 100 Advanced ERP\MAS90\Home")
    Set oSS = oScript.NewObject("SY_Session")

    retVal = oSS.nlogon()
    retVal = oSS.nSetCompany(MAS_SCR_CMP)
    retVal = oSS.nSetDate("A/P", MAS_SCR_DTE)
    retVal = oSS.nSetModule("A/P")
    TaskID = 0

    TaskID = oSS.nLookupTask("AP_VendorElectronicPayment_ui")

    oSS.nSetProgram(TaskID)

    Set epay = oScript.NewObject("AP_VendorElectronicPayment_bus", oSS) 'It fails on this line.

  • 0 in reply to willHyland
    SUGGESTED
    Is the Enable ACH Electronic Payment option turned on in A/P Options for the company? My guess is that it isn't. You can also check oss.LastErrorMsg to see if a message is being set for the failure to create the object.

    Thanks,
    Kent
  • 0 in reply to Kent Mackall

    Thanks for your input, Kent. ACH is turned on. I have been doing this manually in the company. I am using my account, which has rights to everything. This is a vbscript that is attached to a button. I am wondering how I even get the last error message, because the script throws an exception and doesn't allow you to continue. I am getting the same error in a test C# script, so I will do a try catch and see if I can get the last error out of oSS on the catch.

    EDIT: I just caught the oSS last error message.  It is saying that I am not authorized to use this program.  I can do it with the same user account in MAS UI.  I am very confused!

  • 0 in reply to willHyland
    Something in the Role and User setup for this User and Company is not correct. Double check Role Security for the user you are logging in as in the script and for the company you are setting as MAS_SCR_CMP and make sure the user/company has full rights to the Check and Electronic Payment Maintenance Task and that the Allow Vendor Electronic Payment Module Option is selected. In User Maintenance, make sure the correct role with those options turned on is selected for the company.