Announcements
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
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.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156