I often run into people importing payables transactions using SmartConnect where some of the vendors are 1099 vendors and some are not.  When you import a transaction for the 1099 vendor, the 1099 amount needs to be the same as the transaction amount.  However, people don’t typically know which vendors are 1099 vendors before they run the import.  This article will explain how to automatically determine if the vendor is a 1099 vendor, and then update the 1099 amount only for those transactions.  We will do this by creating a calculated field for the 1099 amount that will connect to SQL and then check what the 1099 status on the vendor is. 

First thing we need to do is create a new “MSSQL Default” connection to use in our script.  In order to do this, open SmartConnect, go to the Maintenance tab, and then click on the “MSSQL Defaults” button and then click on the “Add” button

Once you are in the “Default Microsoft SQL Servers” window, you then want to create a connection to the specific company you are running the map into.  In my case, I am using my Fabrikam company, which in my database happens to be called “GPTWO”.  You should actually use SQL authentication in this window, if you change it to “Use Windows Authentication” you will need to add all the windows users to SQL in order for them to run this map.  I have set mine up using the sa user, however you can use any SQL user that is a member of the DYNGRP in this specific database.

After creating your default SQL connection, next we need to create a calculated field.  Open up the payables transaction mapping, and then click on the “Additional Columns” button, and then select “Columns” and “Calculated.”

Name your calculated field TEN_NINETY_NINE_AMT. Erase the default script in the window, and then paste the attached text file into the Calculation Field.  After pasting the script into the window, the window will look like this.

You need to edit just 3 locations in the script.  I have circled them below. 

You need to replace _VENDORID with the name of the source column that contains your vendor ID.  You need to replace _AMOUNT with the name of the source column that contains your document amount.  You need to replace _SQLDEF_GPTWO with the name of the default SQL connection you created in the first step of this document.  In the screenshot below, I am dragging and dropping the fields from the “Fields” window into the script window to make sure I don’t mistype any of them.

After updating the script with the correct field names, press the validate button.  If the script doesn’t validate, it means one of the three fields you dragged into the script are mistyped.  Once you get the script to validate, click the OK button to close the script window. 

After the script is saved, then you can map the field by dragging and dropping the field into the “1099 Amount” mapping. 

Have questions? Give us a shout at support@eonesolutions.com.