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 :
Microsoft Dynamics GP (Archived)

Integration Manager VB Script calling SQL Stored Proc

(0) ShareShare
ReportReport
Posted on by 65,271

I'm creating an integration that needs to call a SQL Stored Procedure in the After Document script. The VB Script passes 4 variables to the Stored Proc so that it can take those values and go off and do something else. A couple of the parameters are dates, the others are strings.

I've gotten it to 'work', but there has got to be a more elegant way to do this. How would you script this?

Kind regards,

Leslie

*This post is locked for comments

I have the same question (0)
  • Ian Grieve Profile Picture
    22,784 on at

    Hi Leslie,

    I'd use something like the following:

    Set oCon = CreateObject("ADODB.Connection")

    'open the connection

    oCon.Open GetVariable("sDSN")

    strSQL = "EXEC " & GPConnection.GPConnIntercompanyID & "..INSERT_IG_IM_SPROC " & _

    "'" & SourceFields("GL Trans Header.DocNum") & _

    "', '" & SourceFields("GL Trans Header.Date") & _

    "', '" & SourceFields("GL Trans Header.Reference") & _

    "', '" & SourceFields("GL Line Detail.Amount") & "'"

    'Execute the statement

    oCon.Execute strSQL

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 > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans