Sage 100

 View Only
  • 1.  Error in vbscript calling stored procedure and passing Sales Order number as parameter

    Posted 02-06-2024 11:08

    Sage 100 Premium 2022 - button script on Sales Order Header to update the value of a UDF from another database.

    Portion of script::

    59    sSQL = "DEX.dbo.spS100_WOStatusForSO"
    60    oCmd.CommandType = 4 'stored procedure
    61    oCmd.commandtext = sSQL
    62    oCmd.NamedParameters = true
    63    oCmd.Parameters.Append (oCmd.CreateParameter("@SO",adVarChar,adParamInput,7,sSO))
    64    oCmd.Parameters.Append (oCmd.CreateParameter("@ST",adVarChar,adParamOutput,50))
    65    oCmd.Execute()

    OLE Error Number : 3001
    Description : Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
    Language : VBScript 
    Script Line : 63

    Multiple sites googled tell me my code is correct.

    MAS_User has been granted execute permissions on the stored procedure

    What am I missing?

    #scripting #buttonscript

    Phil



    ------------------------------
    Phil McIntosh
    Friendly Systems, Inc.
    ------------------------------


  • 2.  RE: Error in vbscript calling stored procedure and passing Sales Order number as parameter

    Posted 02-06-2024 13:24

    I believe a button script, set to run from the server, should run in the security context of the Sage Service (not MAS_User).



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 3.  RE: Error in vbscript calling stored procedure and passing Sales Order number as parameter

    Posted 02-06-2024 16:20

    Thanks @Kevin Moyes, but unfortunately that didn't fix the issue....



    ------------------------------
    Phil McIntosh
    Friendly Systems, Inc.
    ------------------------------



  • 4.  RE: Error in vbscript calling stored procedure and passing Sales Order number as parameter

    Posted 02-06-2024 23:13

    Are those constants predefined in your code? They aren't built-in to the interpreter. (adVarChar, adParamInput)

    Does sSO need to be predefined?



    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    Corvallis OR
    541-224-6642
    ------------------------------



  • 5.  RE: Error in vbscript calling stored procedure and passing Sales Order number as parameter

    Posted 02-07-2024 12:30

    @Dan Burleson - thank you sir!  That was it!



    ------------------------------
    Phil McIntosh
    Friendly Systems, Inc.
    ------------------------------