CreateTransactionEntity Method
Creates a transaction from an eConnect XML document. Returns a string that includes XML for the document that was created.
Class
Microsoft.Dynamics.GP.eConnect.eConnectMethods
Syntax
public string CreateTransactionEntity(string connectionString, string sXML)
Parameters
Name |
Data type |
Description |
---|---|---|
connectionString |
string |
Specifies your data server and database. |
sXML |
string |
An eConnect XML document. |
Return Value
Type: string
The return value is a string that contains the XML for the document that was created.
Remarks
Use the CreateTransactionEntity method to create new transaction data in Microsoft Dynamics GP. For example, use CreateTransactionEntity to add a sales order or inventory transaction document.
To submit a document, create a string that represents the eConnect XML document. Use the string as the sXML parameter.
Use the return value to verify the data that was created. For example, use the XML to obtain the document ID for transaction documents that automatically generate document ID numbers.
If an error occurs, the method throws an eConnectException, application exception, or exception.
Examples
The following Visual Basic .NET code example creates a sales order document. The XML that specifies the sales order to create is retrieved from the file named CustomerDelete.xml. Notice how the CreateTransactionEntity returns an XML string that represents the new sales order.
'Load the eConnect XML document into an XMLDocument object Dim xmldoc As New Xml.XmlDocument xmldoc.Load("SalesOrder.xml ") 'Use the XMLDocument object to create an XML string representation 'of the eConnect XML Sales Order 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" 'Use CreateTransactionEntity to create the sales order document 'in Microsoft Dynamics GP Dim newSalesOrder As String newSalesOrder = eConCall.CreateTransactionEntity(sConnectionString, salesOrderDocument)