Skip to content
+1-888-319-3663

COMMUNITY FORUM

Run SQL command tasks against company databases in the map

Kevin asked 7 years ago
We have several accounts that are not marked to allow account entry to prohibit users from entering transactions against those accounts. We also have several imports/maps that need to use those accounts. We are wanting to setup a “Before map” task to run a sql command to mark those accounts to allow entry, then another sql command that would run after the map is completed to change those accounts back to not allow entry. The question I have is we have several maps that could be used for multiple companies, so I am looking for a way to identify which company the sql script should run against. Any ideas how to get this information for the scripts?
 
Thanks,
Kevin
Chris Dew replied 7 years ago

Kevin, If you are on the latest versions of SmartConnect then the best approach may be to just add the taUpdateCreateAccountRcd in with the existing Transactions nodes (using Node Maintenance). You can add it twice, (one that runs before the lines and header and then one that runs after). If you do it this way then it will take the context of the company you are bringing the transactions into. Another way would be to use a piece of data in your source that indicates which company and pass that in as a parameter in the SQL Script. Something like below:
update _myDataField..GL00100 set ACCTENTR = 1 WHERE Account = myAccount.

Answers
Chris Dew answered 7 years ago
Answer below.

If you would like to submit an answer or comment, please sign in to the eOne portal.