Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP forum
Suggested answer

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

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. 

Categories:
  • 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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans