Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

eConnect Receivables Invoice - CreateTransactionEntity - More than one Transaction - VB.Net Code

nooruddinazhar (IS/IT--Management) (OP)
21 Jul 12 17:28
Hi,

In the samples provided in the eConnect Documentation, everywhere it's for single record i.e. for one single node for any transaction type. If I want to upload more than one transaction - multiple transactions - my code doesn't work. Always my only single record is getting inserted into Dynamics GP. I want to insert more than one, where am I missing?

In my below code at : eConnect.RMTransactionType(0) = MyType(0)

I want to send two records & similarly in a loop multiple records basically the taRMtransaction object should be made an array & passed to the RMTransactionType(0) object. How to be done? Pls. help.

Public Shared Sub SerializeReceivablesObject(ByVal filename As String)



Try

Dim MyType(1) As RMTransactionType

Dim MyTransactions(1) As taRMTransaction

Dim LineItems(1) As taRMTransaction





'Populate the XML node object

LineItems(0) = New taRMTransaction

With LineItems(0)

.BACHNUMB = "MYBATCH"

.BatchCHEKBKID = "UPTOWN TRUST"

.SLSAMNT = "100"

.DOCAMNT = "100"

.CASHAMNT = 0

.CUSTNMBR = "AARONFIT0001"

.DOCDATE = DateTime.Parse("01/06/2012")

.DOCNUMBR = "INV17062012-001"

.SALSTERR = "TERRITORY 1"

.SLPRSNID = "PAUL W."

.RMDTYPAL = "1"

End With



MyTransactions(0) = LineItems(0)

LineItems(1) = New taRMTransaction

With LineItems(1)

.BACHNUMB = "MYBATCH"

.BatchCHEKBKID = "UPTOWN TRUST"

.SLSAMNT = "200"

.DOCAMNT = "200"

.CASHAMNT = 0

.CUSTNMBR = "ADAMPARK0001"

.DOCDATE = DateTime.Parse("01/06/2012")

.DOCNUMBR = "INV17062012-002"

.SALSTERR = "TERRITORY 2"

.SLPRSNID = "SANDRA M."

.RMDTYPAL = "1"

End With



MyTransactions(1) = LineItems(1)





Dim eConnect As New eConnectType

Dim MyeConnect(1) As eConnectType

Dim MyTransaction As New taRMTransaction

ReDim Preserve eConnect.RMTransactionType(0)



Dim MyTransArray As New List(Of taRMTransaction)()



MyTransArray.Add(MyTransactions(0))

MyTransArray.Add(MyTransactions(1))



MyType(0) = New RMTransactionType

MyType(1) = New RMTransactionType



MyType(0).taRMTransaction = MyTransArray.Item(0)

MyType(1).taRMTransaction = MyTransArray.Item(1)



eConnect.RMTransactionType(0) = MyType(0)



'Create a file and stream to use to serialize the XML document to a file

Dim fs As New FileStream(filename, FileMode.Create)

Dim writer As New XmlTextWriter(fs, New UTF8Encoding)



'Serialize the XML document to the file

Dim serializer As New XmlSerializer(GetType(eConnectType))

serializer.Serialize(writer, eConnect)

writer.Close()









Catch ex As ApplicationException

Console.Write(ex.ToString)

End Try



End Sub

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close