eConnect - RMApplyType

This is a complete working example of the RMApply eConnect transaction

 

Sub RMApply(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 a list of pending FROM documents
        For Each oHeaderRow In SPs.dd_DDtaRMApply_SEL_byAPFRDCNM().getTable.Rows
 
            'loop through the lines
            For Each oRow In SPs.dd_DDtaRMApply_SEL_byAPFRDCNM2(oHeaderRow("apfrdcnm"), oHeaderRow("apfrdcty")).getTable.Rows
                Dim oRMApplyType As New Microsoft.Dynamics.GP.eConnect.Serialization.RMApplyType
                'declare an object for the detail line
                Dim otaRMApply As New Microsoft.Dynamics.GP.eConnect.Serialization.taRMApply
 
                'populate the detail line
                With otaRMApply
                    .APTODCNM = oRow("APTODCNM")
                    .APTODCTY = oRow("APTODCTY")
                    .APFRDCNM = oRow("APFRDCNM")
                    .APFRDCTY = oRow("APFRDCTY")
                    .APPTOAMT = oRow("APPTOAMT")
                    .GLPOSTDT = oRow("GLPOSTDT")
                    .DISTKNAM = oRow("DISTKNAM")
                    '.CHEKBKID = oRow("CHEKBKID")
                    .WROFAMNT = oRow("WROFAMNT")
                    .APPLYDATE = oRow("APPLYDATE")
                    .GLPOSTDT = oRow("GLPOSTDT")
                    oRMApplyType.taRMApply = otaRMApply
                End With
 
                ReDim Preserve oeConnectType.RMCashReceiptsType(0)
                oeConnectType.RMApplyType(0) = oRMApplyType
                '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")).execute()
            Next
 
 
        Next
 
    Catch ex As Exception
        ErrorHandler.globalErrorHandler(ex, bShowErrors)
    End Try
 
End Sub
                       


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