I am creating a taSopHdrIvcInsert and taCreateSopPaymentInsertRe
Code I have so far is to create econnect object and assign taSopHdrIvcInsert is :
Dim spSOP As New
SOPTransactionType
Try
' for serialization, add items to a sop transaction type
ReDim Preserve
spSOP.taSopLineIvcInsert_Items(1)
spSOP.taSopLineIvcInsert_Items = LineItems spSOP.taSopHdrIvcInsert = objtaSopHdrIvcInsert
Catch ex As
Exception
objMessageLog.InsertMessageLog(intTranID, strStoreID, intRegID,
"CreateSalesOrder", "Error creating SOPTransactionType "
& ex.Message)
End
Try
'Serialize xml form of SOP to memory with a string writer
Dim oStringWriter As New
System.IO.StringWriter
Dim writer As New
Xml.XmlTextWriter(oStringWriter)
Dim eConnect As New eConnectType
' serializable entity
Try
ReDim Preserve
eConnect.SOPTransactionType(0)
eConnect.SOPTransactionType(0) = spSOP
Catch ex As
Exception
objMessageLog.InsertMessageLog(intTranID, strStoreID, intRegID,
"CreateSalesOrder", "Error setting SOPTransactionType "
& ex.Message)
End
Try
Try
Dim serializer As New System.Xml.Serialization.XmlSerializer(GetType
(eConnectType))
serializer.Serialize(writer, eConnect)
Catch ex As
Exception
objMessageLog.InsertMessageLog(intTranID, strStoreID, intRegID,
"CreateSalesOrder", "Error serialising "
& ex.Message)
End
Try
Dim eConnectObject As New
Microsoft.Dynamics.GP.eConnect.eConnectMethods
Try
bleConnectResult = eConnectObject.eConnect_EntryPoint(strConnectionString, _
EnumTypes.ConnectionStringType.SqlClient, oStringWriter.ToString, EnumTypes.SchemaValidationType.None)
Catch ex As
Exception
If ex.ToString().IndexOf("Error Number = 5616") >= 0
Then
intConnectResult = -1
Else
objMessageLog.InsertMessageLog(intTranID, strStoreID, intRegID,
"CreateSalesOrder", "Error eConnecting transaction " & intTranID.ToString & " "
& ex.Message)
End
If
End
Try
*This post is locked for comments
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156