Retrieving a document number

The GetNextDocNumbers class includes methods that enable you to retrieve several types of Microsoft Dynamics GP document numbers. Typically, you use the GetNextDocNumbers class when you use eConnect to create a new record in Microsoft Dynamics GP.

The following Visual Basic example shows how to use the GetNextDocNumbers class to get document numbers for several types of documents.

'Use the connection string to connect to the TWO database 
‘ on the local computer
Dim connectionString As String
connectionString = "Data Source=localhost;Integrated
Security=SSPI;" _
	& "Persist Security Info=False;Initial Catalog=TWO;"

'Instantiate a GetNextDocNumbers object
Dim getDocNumbers As New GetNextDocNumbers()

'Use the GetNextDocNumbers object to retrieve a series of Microsoft
Dynamics ‘ GP document numbers
Dim poNumber = getDocNumbers.GetNextPONumber( _
	GetNextDocNumbers.IncrementDecrement.Increment,
connectionString)
Dim invNumber = getDocNumbers.GetNextIVNumber( _
	GetNextDocNumbers.IncrementDecrement.Increment, _
	GetNextDocNumbers.IVDocType.IVAdjustment, connectionString)
Dim rmNumber = getDocNumbers.GetNextRMNumber( _
	GetNextDocNumbers.IncrementDecrement.Increment, _
	GetNextDocNumbers.RMPaymentType.RMReturn, connectionString)
Dim pmNumber = getDocNumbers.GetPMNextVoucherNumber( _
	GetNextDocNumbers.IncrementDecrement.Increment,
connectionString)
Dim sopNumber = getDocNumbers.GetNextSOPNumber( _
	GetNextDocNumbers.IncrementDecrement.Increment, "STDINV", _
	GetNextDocNumbers.SopType.SOPInvoice, connectionString)


Documentation Feedback