eConnect - RMCashReceiptsType example

This article is a complete example of the code needed to send an RMCashreceiptsInsert transaction to Dynamics GP

 

 

Imports eConnect11Data
Imports FPCommon
 
Public Class RMIntegration
    Sub RMCashReceipt(bShowErrors As Boolean)
        Try
            'we expect the data to be in the custom DDtaRMCashReceiptInsert table
 
            Dim strReturnDoc As String
 
            'declare our eConnect classes
            Dim strSQLServer As String = System.Configuration.ConfigurationManager.AppSettings("SQLServer")
            Dim strDabase As String = System.Configuration.ConfigurationManager.AppSettings("Database")
            Dim oeConnectType As New Microsoft.Dynamics.GP.eConnect.Serialization.eConnectType
 
            'this is our eConnect common functions class, you can find it here: http://dyndeveloper.com/thread.aspx?Threadid=1117
            Dim oeConnectFunctions As New eConnectFunctions(strSQLServer, strDabase)
 
            '============================================================================
            'create the document details
            '============================================================================
            'get all the lines in the custom DDtaRMCashReceiptInsert table
            Dim oDT As DataTable = SPs.DD_DDtaRMCashReceiptInsert_SEL().getTable
 
            'loop through the lines
            For Each oRow In oDT.Rows
                Dim oRMCashReceiptsType As New Microsoft.Dynamics.GP.eConnect.Serialization.RMCashReceiptsType
 
                'declare an object for the detail line
                Dim otaRMCashReceiptInsert As New Microsoft.Dynamics.GP.eConnect.Serialization.taRMCashReceiptInsert
 
                'populate the detail line
                With otaRMCashReceiptInsert
                    .BACHNUMB = oRow("BACHNUMB")
                    .CUSTNMBR = oRow("CUSTNMBR")
                    .DOCNUMBR = oRow("DOCNUMBR")
                    .DOCDATE = oRow("DOCDATE")
                    .ORTRXAMT = oRow("ORTRXAMT")
                    .GLPOSTDT = oRow("GLPOSTDT")
                    .CSHRCTYP = oRow("CSHRCTYP")
                    .CHEKBKID = oRow("CHEKBKID")
                    .CHEKNMBR = oRow("CHEKNMBR")
                    .CRCARDID = oRow("CRCARDID")
                    .TRXDSCRN = oRow("TRXDSCRN")
                    oRMCashReceiptsType.taRMCashReceiptInsert = otaRMCashReceiptInsert
                End With
 
                ReDim Preserve oeConnectType.RMCashReceiptsType(0)
                oeConnectType.RMCashReceiptsType(0) = oRMCashReceiptsType
                'this is our eConnect common functions class, you can find it here: http://dyndeveloper.com/thread.aspx?Threadid=1117
                strReturnDoc = oeConnectFunctions.CreateTransactionEntity(oeConnectType)
 
                'delete the line that we just integrated
                SPs.DD_DDtaRMCashReceiptInsert_DEL_byID(oRow("RowID"))
            Next
 
        Catch ex As Exception
            ErrorHandler.globalErrorHandler(ex, bShowErrors)
        End Try
 
    End Sub
 
End Class
                       


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences