web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Integration Manager VBScript for eConnect - Destination Settings

(0) ShareShare
ReportReport
Posted on by 3,951

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:
I have the same question (0)
  • Suggested answer
    Isaac Olson Profile Picture
    on at

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 663 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 540 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 348 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans