Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

GP2013 - eConnect taRMApply - Multi-Currency Transactions Not working

(0) ShareShare
ReportReport
Posted on by 120

Hello,

Have anyone tried using taRMappy method to apply receivables credit documents (credit memos / Returns)  against the Invoices OR Debit Memos, etc?  It works for the Functional Currency transactions but fails for foreign currency transactions.  Is it still not supporting with GP2013?  

What are the other way around to apply Credit Memos / Returns against the invoices as I've daily around 400 Returns to be applied against 2000 Invoices / Debit Memos?  Overall daily my returns would be 30% of my total sales documents which, If I don't apply, will reflect in aging as negative balances.

Any help / clue is highly appreciable.

Thanks.

AZEEM

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: GP2013 - eConnect taRMApply - Multi-Currency Transactions Not working

    I'm still on GP 2013 R2 and trying to import a EURO cash receipt to a USD Functional company.  Did this ever get a resolution?  Can you do an import with Integration Manager or Lockbox Entry in Originating Euro currency?  I've so far not been able to successfully build it even though we can do this manually through the UI.

  • Community Member Profile Picture
    on at
    RE: GP2013 - eConnect taRMApply - Multi-Currency Transactions Not working

    Hello,

    Did you find any solution to this problem? I have similar issue and saw your posting.

    Thanks,

    Farzana

  • Muhammad_azeemuddin@yahoo.com Profile Picture
    120 on at
    RE: GP2013 - eConnect taRMApply - Multi-Currency Transactions Not working

    Hello Moorthy,

    Any clues???

    Thanks.

    AZEEM.

  • Muhammad_azeemuddin@yahoo.com Profile Picture
    120 on at
    RE: GP2013 - eConnect taRMApply - Multi-Currency Transactions Not working

    Hi Moorthy,

    Thanks for all your efforts.  Sorry for getting delayed in responding.  Once again, yes I can apply it through the screen but I noticed that, while applying it shows the  in Originating currency (Foreign Currency), may be that's what is the clue, as taRMApply class doesn't take any currency parameter to pass.  Anyways, kindly see the below screen shot of the error, which clearly indicates that either of the document (ApplyTo OR ApplyFrom) is not in the Functional currency.  This error means that, this taRMApply class doesn't support foreign currency transactions.  I've also pasted the source code in the last below this error screen shot.  

    Your valuable input is appreciated.

    Thanks.

    AZEEM.

        Private Sub BtnApply_Click(sender As Object, e As EventArgs) Handles BtnApply.Click

            Dim MySQL As String

            Dim MyPosSql As String

            Dim CheckCust As String

            CheckCust = ""

     

            MySqlConn.ConnectionString = "data source=XYZ;initial catalog=ABC;uid=sa;password=admin;packet size=4096;MultipleActiveResultSets=True"

     

            Using eConCall As New eConnectMethods

     

                Try

                    MySqlConn.Open()

                    Label4.Text = Now.TimeOfDay.ToString

    ComeToStartAgain:

                    'For Functional / Local Currency transactions this query

                    'MySQL = "SELECT CUSTNMBR, DOCNUMBR, DOCDATE, RMDTYPAL, ORTRXAMT, CURTRXAM  FROM RM20101 WHERE RMDTYPAL IN('7','8') AND "

                    'MySQL = MySQL + " TRXDSCRN LIKE '%IMPORT%' AND (DOCDATE>='" + Me.DTPicker1.Value.Date + "' AND DOCDATE<='" + Me.DTPicker2.Value.Date + "') AND "

                    'MySQL = MySQL + " CURTRXAM>0 and CUSTNMBR> '" + CheckCust + "' AND LEFT(CUSTNMBR,1)='3' ORDER BY CUSTNMBR, RMDTYPAL, DOCDATE, DOCNUMBR"

     

                    'For Foreign Currency transactions this query

                    MySQL = "SELECT CUSTNMBR, DOCNUMBR, DOCDATE, RMDTYPAL, ORCTRXAM, CURNCYID  FROM MC020102 WHERE RMDTYPAL IN('7','8') AND "

                    'MySQL = MySQL + " TRXDSCRN LIKE '%IMPORT%' AND "

                    MySQL = MySQL + "  (DOCDATE>='" + Me.DTPicker1.Value.Date + "' AND DOCDATE<='" + Me.DTPicker2.Value.Date + "') AND "

                    MySQL = MySQL + " ORCTRXAM>0 and CUSTNMBR> '" + CheckCust + "' AND LEFT(CUSTNMBR,1)='3' ORDER BY CUSTNMBR, RMDTYPAL, DOCDATE, DOCNUMBR"

     

                    MySQLCmd.CommandText = MySQL.ToString

                    MySQLCmd.Connection = MySqlConn

     

                    MyNegSQLDataReader = MySQLCmd.ExecuteReader

     

                    MyRecCountCmd.CommandText = "SELECT COUNT(*) FROM RM20101 WHERE RMDTYPAL IN('7','8') AND TRXDSCRN LIKE '%IMPORT%' AND (DOCDATE>='" + Me.DTPicker1.Value.Date + "' AND DOCDATE<='" + Me.DTPicker2.Value.Date + "') AND LEFT(CUSTNMBR,1)='3' AND CURTRXAM>0"

                    MyRecCountCmd.Connection = MySqlConn

     

     

                    If MyNegSQLDataReader.HasRows = False Then

                        Label5.Text = Now.TimeOfDay.ToString

                        Label5.Refresh()

                        MsgBox("Completed Application.", MsgBoxStyle.Information, "Dot Net Application.")

                        Exit Sub

                    End If

     

                    Dim i As Integer = 0

                    Dim MyRecCount As Int64

                    MyRecCount = MyRecCountCmd.ExecuteScalar

                    MyRecCountCmd.Dispose()

     

     

     

     

                    While MyNegSQLDataReader.Read()

     

     

                        i += 1

     

                        MyNegDocType = MyNegSQLDataReader.Item(3)

                        MyNegCustNmbr = MyNegSQLDataReader.GetString(0)

                        MyNegDocNumber = MyNegSQLDataReader.GetString(1)

                        MyNegNumber = MyNegSQLDataReader.Item(4)

                        Label1.Text = "Customer#: " & MyNegCustNmbr & " Negative Doc#: " & MyNegDocNumber

                        Label1.Refresh()

                        Label3.Text = "Record#: " & i & " of " & MyRecCount.ToString

                        Label3.Refresh()

                        'For Functional / Local Currency transactions this query

                        'MyPosSql = "SELECT CUSTNMBR, DOCNUMBR, DOCDATE, RMDTYPAL, ORTRXAMT, CURTRXAM  FROM RM20101 WHERE RMDTYPAL IN('1','3','4','5','6') AND "

                        'MyPosSql = MyPosSql + " CUSTNMBR='" + MyNegCustNmbr + "' AND LEFT(CUSTNMBR,1)='3' AND (DOCDATE>='" + Me.DTPicker1.Value.Date + "' AND DOCDATE<='" + Me.DTPicker2.Value.Date + "') "

                        'MyPosSql = MyPosSql + "  AND CURTRXAM>0  ORDER BY CUSTNMBR, DOCDATE, DOCNUMBR"

     

                        'For Foreign Currency transactions this query

                        MyPosSql = "SELECT CUSTNMBR, DOCNUMBR, DOCDATE, RMDTYPAL, ORCTRXAM, CURNCYID FROM MC020102 WHERE RMDTYPAL IN('1','3','4','5','6') AND "

                        MyPosSql = MyPosSql + " CUSTNMBR='" + MyNegCustNmbr + "' AND LEFT(CUSTNMBR,1)='3' AND (DOCDATE>='" + Me.DTPicker1.Value.Date + "' AND DOCDATE<='" + Me.DTPicker2.Value.Date + "') "

                        MyPosSql = MyPosSql + "  AND ORCTRXAM>0  ORDER BY CUSTNMBR, DOCDATE, DOCNUMBR"

     

     

                        MyPosSQLCmd.CommandText = MyPosSql.ToString

                        MyPosSQLCmd.Connection = MySqlConn

     

                        MyPosSQLDataReader = MyPosSQLCmd.ExecuteReader

     

                        If MyPosSQLDataReader.HasRows = False Then

                            MyPosSQLDataReader.Close()

                            MyNegSQLDataReader.Close()

                            'GoTo ComeHereDarling

                            CheckCust = MyNegCustNmbr

                            GoTo ComeToStartAgain

     

                        End If

     

                        Label1.Text = Label1.Text & " Negative Amount: " & MyNegNumber

                        Label1.Refresh()

                        While MyPosSQLDataReader.Read

                            If MyNegNumber > 0 Then

                                MyPosDocType = MyPosSQLDataReader.Item(3)

                                MyPosCustNmbr = MyPosSQLDataReader.GetString(0)

                                MyPosDocNumber = MyPosSQLDataReader.GetString(1)

                                MyPosNumber = MyPosSQLDataReader.Item(4)

                                Label2.Text = "Customer#: " & MyPosCustNmbr & " Positive Doc#: " & MyPosDocNumber & " Positive Amount: " & MyPosNumber

                                Label2.Refresh()

                                SerializeApplyWriteOffsObject("ApplyDocs.xml")

                                Dim XmlDoc As New Xml.XmlDocument

                                Dim ApplyDocument As String

                                Dim sConnectionString As String

                                Dim ApplyRec As String

     

     

                                XmlDoc.Load("ApplyDocs.xml")

                                ApplyDocument = XmlDoc.OuterXml

                                sConnectionString = "data source=XYZ;initial catalog=ABC;integrated security=SSPI;packet size=4096"

                                ApplyRec = eConCall.CreateTransactionEntity(sConnectionString, ApplyDocument)

     

     

     

     

                                MyPosSQLDataReader.Close()

                                MyNegSQLDataReader.Close()

                            End If

                            GoTo ComeToStartAgain

                        End While

                        MyPosSQLDataReader.Close()

                        MyNegSQLDataReader.Close()

                        GoTo ComeToStartAgain

    ComeToNextNegRec:

                    End While

     

     

                Catch Exp As eConnectException

                    MsgBox(Exp.ToString())

                Catch ex As Exception

                    MsgBox(ex.ToString())

                Finally

     

                    MyPosSQLDataReader.Close()

                    MyNegSQLDataReader.Close()

                    eConCall.Dispose()

                    MyConn.Close()

                End Try

     

     

            End Using

     

        End Sub

     

     

     

     

     

     

        Public Sub SerializeApplyWriteOffsObject(ByVal filename As String)

     

            Try

                'Create an array that holds two taSopLineIvcInsert_ItemsTaSopLineIvcInsert XML node objects

                'Dim LineItems(1) As taSopLineIvcInsert_ItemsTaSopLineIvcInsert

                Dim MyType As New RMApplyType

                Dim MyTransaction(0) As taRMApply

                'Dim MyGroupChild As RMParentIDChildType

                'Create a taSopLineIvcInsert_ItemsTaSopLineIvcInsert XML node object

     

     

                'Populate the XML node object

                MyTransaction(0) = New taRMApply()

                With MyTransaction(0)

                    .APFRDCNM = MyNegDocNumber

                    .APFRDCTY = MyNegDocType

                    .APPLYDATE = Me.DTPicker2.Value.Date

     

                    If MyNegNumber = MyPosNumber Then

                        .APPTOAMT = MyNegNumber

                    ElseIf MyNegNumber > MyPosNumber Then

                        .APPTOAMT = MyPosNumber

                    ElseIf MyNegNumber < MyPosNumber Then

                        .APPTOAMT = MyNegNumber

                    End If

                    .APTODCNM = MyPosDocNumber

                    .APTODCTY = MyPosDocType

                    '.DISTKNAM = 0

                    .GLPOSTDT = Me.DTPicker2.Value.Date

                    '.WROFAMNT = .APPTOAMT

                    'ReInitializeVariables()

     

                End With

     

     

                Dim eConnect As New eConnectType()

                ReDim Preserve eConnect.RMApplyType(0)

                MyType.taRMApply = MyTransaction(0)

                'MyType.taParentIDChild_Items = m

                'MyType.taRMDistribution_Items = MyDistributions

                eConnect.RMApplyType(0) = MyType

     

                '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

  • Suggested answer
    soma Profile Picture
    24,410 on at
    RE: GP2013 - eConnect taRMApply - Multi-Currency Transactions Not working

    First try to manually apply credits/returns to invoices in GP, if you able to apply this manually, then the problem is on your code only. So, share me the code if you able to apply manually in GP.

    Note: All the credit an debit documents from your input data should be posted in GP before applying to any documents.

    Your reply is much appreciated.

    Hope this helps!!!

  • Muhammad_azeemuddin@yahoo.com Profile Picture
    120 on at
    RE: GP2013 - eConnect taRMApply - Multi-Currency Transactions Not working

    Dear Moorthy,

    Thanks for the reply.  But there is slight mis-understanding, I believe.  Let me clarify that, my functional currency is US$ and we also deal in Euros - which is foreign OR originating currency.  Now, using taRMApply I can successfully write-off (apply credits against debits) the returns against the Invoices for Functional Currency (Dollar $) transactions.  Similarly I want to do the same for my transactions of my other branch in London where the transactions are in originating currency (Euros) & here it fails.  How to do this?  If you want, I can send you my source code.  Once again, appreciate your efforts.

    Thanks.

    AZEEM.

  • soma Profile Picture
    24,410 on at
    RE: GP2013 - eConnect taRMApply - Multi-Currency Transactions Not working

    GP allow us to apply RM cash receipts for below currency format only.

         Cash Receipt                              Invoice

    1. Functional Currency                  Originating Currency

    2. Originating Currency                 Functional Currency

    3. Originating Currency                 Originating Currency

    We can't apply Originating Currency Cash Receipt to Originating Currency Invoice.

    Hope this helps!!!

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans