I need some help with changing the below EFT Flag SCript to allow for Alpha numeric Next EFT Number. this one was noted to only work with numeric and we use EFT-1234567 -
THANK YOU!
Krista
--after script vba
set MyCon = CreateObject("ADODB.Connection")
MyCon.Connectionstring = "database=" + GPConnection.GPConnInterCompanyID
GPConnection.Open(MyCon)
updatecommand = "update RM10201 "
updatecommand = updatecommand & " set EFTFLAG = '1'"
updatecommand = updatecommand & " where bachnumb='EFT'"
recset = MyCon.Execute(updatecommand )
--Use script vba. For what I did the next eft number MUST be numeric and not alpha numeric.
'Create a new connection
Set pConnection = CreateObject("ADODB.Connection")
'Open the connection to the database
Call pConnection.Open("Dynamics GP 2010", "sa", "bhssapw")
'Create a new recordset -- that will hold returned data
Set pRecordset = CreateObject("ADODB.Recordset")
'Build a string containing your SQL Select Statement
'In this example, the SQL "Max" function is used, and the
'resulting column is given an alias of 'EFTNumber'.
sSQL = "SELECT EFTRMNEXTNUMBER FROM TFBHS..CM00101 WHERE CHEKBKID='DEPOSITORY'"
'MsgBox ("The SQL statement is: " & sSQL)
'Open the recordset with the SQL SELECT statement
Call pRecordset.Open(sSQL, pConnection)
CurrentField = trim(pRecordset.Fields(0).Value)
'Msgbox trim(pRecordset.Fields(0).Value)
set MyCon = CreateObject("ADODB.Connection")
MyCon.Connectionstring = "database=" + GPConnection.GPConnInterCompanyID
GPConnection.Open(MyCon)
updatecommand = "update CM00101 "
updatecommand = updatecommand & " set EFTRMNEXTNUMBER = EFTRMNEXTNUMBER + 1"
updatecommand = updatecommand & " where CHEKBKID='DEPOSITORY'"
recset = MyCon.Execute(updatecommand )