Home » Listing Details
Top Websites
  1. Dynamics GP Help
    Over 6400 resources listed.
  2. Mark Polino's DynamicAccounting.net
    Over 5100 resources listed.
  3. Rose Business Solutions Blog New
    Over 2200 resources listed.
  4. Developing for Dynamics GP - By David Musgrave and the MS GP Dev Support Team
    Over 1100 resources listed.
  5. Mariano Gomez at The Dynamics GP Blogster
    Over 1000 resources listed.
  6. Microsoft Dynamics Partner Community Blog
    Over 900 resources listed.
  7. Christina Phillips, Steve Endow & Lorren Zemke at Dynamics GP Land
    Over 700 resources listed.
  8. Mohammad Daoud's Dynamics GP Blog
    Over 600 resources listed.
  9. Vaidy Mohan at Dynamics GP - Learn & Discuss
    Over 500 resources listed.
  10. Inside Microsoft Dynamics GP Official Blog
    Over 500 resources listed.
  11. eOne Business Solutions Blog
    Over 400 resources listed.
  12. About Dynamics, Development and Life
    Over 300 resources listed.
  13. Frank Hamelly at GP2theMax
    Over 300 resources listed.
  14. Dynamics CPM
    Over 300 resources listed.
  15. BKD Dynamics GP Insights Blog
    Over 200 resources listed.
  16. Leslie Vail at Dynamics Confessor Blogspot
    Over 200 resources listed.
  17. Victoria Yudin's Dynamics GP Website
    Over 200 resources listed.
    Victoria Yudin
  18. Janakiram M.P. at DynamicsBlogger
    Over 100 resources listed.
  19. VS Tools Forum
    Over 100 resources listed.
    Your Resource for Visual Studio Tools for Dynamics GP
  20. Inside Microsoft Dynamics GP Official Blog
    Over 100 resources listed.
  21. US Dynamics GP Field Team Blog
    Over 100 resources listed.
  22. Catherine Eibner MBS Developer Evangelist
    Over 100 resources listed.
  23. Sivakumar Venkataraman at Interesting Findings & Knowledge Sharing
    Over 100 resources listed.
  24. Dynamics Small Business
    Over 100 resources listed.
  25. Belinda, The GP CSI
    Over 100 resources listed.

ID:10427
Title:How to Create SQL Scripts in Integration Manager without hardcoding the database
URL:http://intouchdynamicsgp.blogspot.com/2010/01/how-to-create-sql-scripts-in.html
Description:Here is a handy bit of code. Have you ever wanted to run a sql script in Integration manager after the task completes but you don't want to hard code the company database so you can use it against multiple companies?

Well here is the code to do this (in version 10), in the script window within Integration manager start off by setting the ADODB connection.

set MyCon = CreateObject("ADODB.Connection")

Then use the connection string to bring back the inter company ID

MyCon.Connectionstring = "database=" + GPConnection.GPConnInterCompanyID

Open your connection

GPConnection.Open(MyCon)


You can then construct your SQL statement, the below is an update statement

updatecommand = "update PM00200 "
updatecommand = updatecommand & " set PHNUMBR1 = 'xxxxx',"
updatecommand = updatecommand & " PHNUMBR2 = 'xxxxx',"
updatecommand = updatecommand & " PHONE3 = 'xxxx',"
updatecommand = updatecommand & " FAXNUMBR = 'xxxx'"

Then close the record set and exercute the command

recset = MyCon.Execute(updatecommand )

This becomes a very powerful tool when you combine it with before scripts which will enable you to fill out blank fields with place holders etc and then remove the place holders after the integration completes.

Any questions contact helpdesk@touchstone.co.uk


Category:INTEGRATIONS: Integration Manager
Link Owner:
Date Added:June 17, 2010 06:07:03 PM
Number Hits:120
RatingsAverage rating: (0 votes)
Reviews

No Reviews Yet.