UpdateTransactionEntity Method

Updates a specified transaction in Microsoft Dynamics GP.

Class

Microsoft.Dynamics.GP.eConnect.eConnectMethods

Syntax

public bool UpdateTransactionEntity(string connectionString, string
sXML)

Parameters

[spacer]

Name

Data type

Description

connectionString

string

Specifies your data server and database.

sXML

string

An eConnect XML document.


Return Value

Type: boolean

The method returns a boolean value that indicates whether the XML document was successfully updated. A return value of True indicates the operation succeeded.

Remarks

Use the UpdateTransactionEntity method to update existing transaction data in Microsoft Dynamics GP. For example, use UpdateTransactionEntity to update existing sales order or inventory transaction documents.

To update a document, create a string that represents the updated eConnect XML transaction document. Use the string as the sXML parameter.

If an error occurs, the method throws an eConnectException, application exception, or exception.

Examples

The following Visual Basic .NET code example updates an existing sales order document. The XML that specifies the sales order to update is retrieved from the file named SalesOrderUpdate.xml. Notice how the UpdateTransactionEntity returns a boolean value.

'Load the eConnect XML document into an XMLDocument object
Dim xmldoc As New Xml.XmlDocument
xmldoc.Load("SalesOrderUpdate.xml ")

'Use the XMLDocument object to create an XML string representation 
‘of the updated eConnect Sales Order XML document
Dim salesOrderDocument As String
salesOrderDocument = xmldoc.OuterXml

'Create a connection string to the Microsoft Dynamics GP database
server
'Integrated Security is required. Integrated security=SSPI
Dim sConnectionString As String
sConnectionString = "data source=MySrvr;initial catalog=TWO;" _
	& "integrated security=SSPI;persist security info=False;" _
	& "packet size=4096"

'UpdateTransactionEntity
Dim testResult As Boolean
testResult = eConCall.UpdateTransactionEntity( _
	sConnectionString, salesOrderDocument)

See Also