The sample application uses classes from the Microsoft.Dynamics.GP.eConnect and Microsoft.Dynamics.GP.eConnect.Serialization assemblies.
The application uses the eConnectMethods class to instantiate an eConnectMethods object. The application uses the CreateTransactionEntity method to create the sales order. The CreateTransactionEntity method needs the sales order XML document and the eConnect connection string.
The CreateTransactionEntity method returns a string. The string contains the XML of the document that was created. You can use the string to verify the document was created or to view values that were generated by eConnect. For example, use the XML in the string to view the document ID assigned to a new sales document.
The application uses several serialization classes to construct an eConnect XML document. To create a sales order document, the sample application instantiates the eConnectType, SOPTransactionType, taSopLineIvcInsert_ItemsTaSopLineIvc-Insert, and taSopHdrIvcInsert classes.
The application instantiates two taSopLineIvcInsert_ItemsTaSopLineIvcInsert objects. It populates each properties of the object to represent a sales order line item. The application completes the sales order by instantiating a taSopHdrIvcInsert object and populating its properties.
To combine the line items and header object into a logical unit, the application instantiates a SOPTransactionType object and populates it with the taSopLineIvcInsert_ItemsTaSopLineIvcInsert and taSopHdrIvcInsert objects. The application completes the eConnect XML document by instantiating an eConnectType object and populating it with SOPTransactionType object.
The application uses a .NET XMLSerializer to write the eConnect XML document to the SalesOrder.xml file. The application passes the XML contents of this file to the eConnect_EntryPoint method.