Back

How to default part of a transaction distribution using SmartConnect

Published: Dec 08, 2011
Post Author Written by David Youngquist

The Microsoft eConnect stored procedures do not include the ability to default part of a transaction. You either need to import all the distributions, or default all of the distributions. You cannot import half of them and default half of them.

You can work around this by writing a SQL query to union the data with itself. In this example a source file was provided that only included the debit side of a payables transaction. The credit side needed to be defaulted. As you can see from the query, the first section is selecting all the lines from the original source file, and using their amounts as a debit. It’s being unioned to itself, in the union query, it is grouped by all fields and then summing the debit amounts to make a credit.

Select [INTERID], [Vendor], [Vendor Name], [Unit number], [Unit Name], [Invc Date], [Invc Nmbr], [DOC TYPE], [total], [GL], 0 As [credit], [subamt] As [debit], [BATCHID], 6 As [DISTTYPE] From [USF$]

UNION

Select [INTERID],[Vendor], [Vendor Name], [Unit number],[Unit Name],[Invc Date], [Invc Nmbr],[DOC TYPE],[total],first([GL]), [total] As [credit], 0 As [debit], [BATCHID], 2 As [DISTTYPE] From [USF$] group by [INTERID],[Vendor],[Vendor Name],[Unit number], [Unit Name],[Invc Date],[Invc Nmbr],[DOC TYPE],[total],[BATCHID]

Feeling stuck? Get the support and guidance you need to help you power through any data challenge

We're on your integration team. Connect with our people and let us know how we can help you.