Compartir a través de


GetNextSopNumber Method

This method will retrieve the next sales document number from Microsoft Dynamics GP.

Class

Microsoft.Dynamics.GP.eConnect.GetSopNumber

Syntax

public string GetNextSopNumber(
    int sopTypeKey,
    string docIdKey,
    string connString
)
Parameters

Name

Data type

Description

sopTypeKey

integer

Specifies the type of the document:

1 = Quote

2 = Order

3 = Invoice

4 = Return

5 = Back order

6 = Fulfillment order

docIdKey

string

Specifies the document ID

connString

string

Specifies the SQL server and database

Return Value

Type: string

This method returns a string that contains the requested SOP number

Examples

The following Visual Basic .NET example uses the GetNextSopNumber method to retrieve a sales invoice number from Microsoft Dynamics GP:

Dim ConnectionString As String
Dim SopNumber As String
'Set the connection string
'This connection string uses integrated security to connect to the
'TWO database on the local computer
ConnectionString = "Data Source=localhost;Integrated Security=SSPI;" _
    & "Persist Security Info=False;Initial Catalog=TWO;"
'Instantiate a GetSopNumber object
Dim SopNumberObject As New GetSopNumber
'Get the next SOP number
SopNumber = SopNumberObject.GetNextSopNumber(3, "STDINV", ConnectionString)

See Also

RollBackSopNumber Method