Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

assigning a payment object to a credit card object

Posted on by 295

I am creating a taSopHdrIvcInsert and taCreateSopPaymentInsertRecord. How can I assign these 2 objects to the same econnect object?  Any suggestions would be great. Thanks

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans