Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Integration Manager Sum two SourceFields (Debit & Credit) for destination Mapping?

(0) ShareShare
ReportReport
Posted on by 115

I am receiving an error message when trying to run my integration for the destination mapping of a field (See code below). I believe its because the script is sending the values as a text instead of numbers. I have not written much vb but there must be a way to do this. My source file is an excel file with a debit and credit columns, however I can not rely on the totals of these columns, which is why I am trying to sum them in IM using vb. 

DOC 1 ERROR: Error Executing Script 'Distributions.Debit Amount' Line 1: - Type mismatch: 'SourceFields'
DOC 2 ERROR: Error Executing Script 'Distributions.Debit Amount' Line 1: - Type mismatch: 'SourceFields'

 VB Script:

CurrentField =SourceValues("ADP TRX Detail.Debit")+SourceValues("ADP TRX Detail.Credit"))

Any help would be much appreciated. 

*This post is locked for comments

  • Suggested answer
    Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: Integration Manager Sum two SourceFields (Debit & Credit) for destination Mapping?

    Try this:

    Dim DebitAmnt
    Dim CreditAmnt
    
    DebitAmnt = CDbl(SourceFields("ADP TRX Detail.Debit"))
    CreditAmnt = CDbl(SourceFields("ADP TRX Detail.Credit"))
    
    CurrentField.Value = DebitAmnt + CreditAmnt


    You can get fancy by ensuring that the source fields themselves are not blank or empty before you make the assignment to each of the variables.

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans