Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Integration Manager VBScript for eConnect - Destination Settings

Posted on by 3,812

I need to add VBScript to update a secondary Table for each Purchase Order (PO) that is imported using the Integration Manager. The PO Integration uses eConnect Adapter. How can I automatically use the Company Database name in the "Destination Settings" Window to create Connection in the VBScript? I find that if we use the "GPConnection.GPConnInterCompanyID" variable, it will retrieve the Company Database based on GP Application that is running and not the "Destination Settings" window. Basically I like to use the same VBScript for both Production and Test Company without hard-coding the Database name in the Script. Following is a sample of the VBScript that I am writing.

After Document Script:

Set recset = CreateObject("ADODB.Recordset")
Set MyCon = CreateObject("ADODB.Connection")
MyCon.Connectionstring = "database=" + GPConnection.GPConnInterCompanyID
GPConnection.Open (MyCon)

updatecommand = "Update POCategoryListTable set [POCategory]= '" & SourceFields("POPHeader.POCategory") & "' where [PONumber]='" & SourceFields("POPHeader.PONumber") & "'"
recset = MyCon.Execute(updatecommand)
MyCon.Close

Following is the Destination Setting window in Integration Manager for PO.

pastedimage1580582632081v1.png

Please Advise. Thank you!

Categories:
  • Suggested answer
    Isaac Olson Profile Picture
    Isaac Olson on at
    RE: Integration Manager VBScript for eConnect - Destination Settings

    Hello, 

    I am not aware of any way to reference the Destination Settings in your VBA scripting, and I do not believe that it would be possible.  The 2 solutions that you listed would be my recommendation as well. 

    1. Either have the company that you are integrating to open in GP so that your connection is pointing to the right place without hard coding it. 

    2. Copy the integration so that you have a test copy and a live copy and hard code the scripting.  

    Another option would be to add a column in the source file itself for whichever company the integration is for and reference that when creating your update statement.  

    Thanks, 

    Isaac Olson

    Microsoft Support

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans