I am trying to write a VB script in Integration manager to set the shipping method on a SOP transaction (at the customer level) to the value of the shipping method in the RM00101 table for that customer. My script compiles, but the value is not getting set. I am sure I'm missing something simple, but I can't figure out the issue. Here is my script:
sCustomerID=Sourcefields("GM_INV_HDR.Customer Number")
'Open a connection to the SQL database
Set MyCon = CreateObject("ADODB.Connection")
MyCon.ConnectionString = "database=" & GPConnection.GPConnInterCompanyID
GPConnection.Open(MyCon)
'Create a new recordset -- that will hold returned data
Set recset = CreateObject("ADODB.Recordset")
sSQL="SELECT SHIPMTHD 'ShipMethod' FROM RM00101 WHERE RM00101.CUSTNMBR = '"& sCustomerID & "'"
'Open the recordset using the SQL statement
set recset = MyCon.Execute(sSQL)
sShippingMethod= recset("ShipMethod")
'Close connection when finished
Call MyCon.Close
'Release the object
Set MyCon = Nothing
Can anyone tell me what I'm missing that it's not setting the value?
Thanks.
Debbie K.