Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Using econnect to get list of sales orders?

Posted on by Microsoft Employee

I am trying to use econnect to get a list of sales orders for x number of days. I followed the only examples available for Customers and I am able to get a list of customers based on their examples.

// Populate the eConnectOut XML node elements
myeConnectOut.ACTION = 1;
myeConnectOut.DOCTYPE = "Customers";
myeConnectOut.OUTPUTTYPE = 2;
myeConnectOut.INDEX1FROM = DateTime.Now.AddDays(-5).ToString();
myeConnectOut.INDEX1TO = DateTime.Now.ToString();
myeConnectOut.FORLIST = 1;

OK, so that works - Now I need to get a list of sales. I tried both "Sales" and "Orders" but neither works.

// Populate the eConnectOut XML node elements
myeConnectOut.ACTION = 1;
myeConnectOut.DOCTYPE = "Orders";
myeConnectOut.OUTPUTTYPE = 2;
myeConnectOut.INDEX1FROM = DateTime.Now.AddDays(-5).ToString();
myeConnectOut.INDEX1TO = DateTime.Now.ToString();
myeConnectOut.FORLIST = 1;

// Populate the eConnectOut XML node elements
myeConnectOut.ACTION = 1;
myeConnectOut.DOCTYPE = "Sales";
myeConnectOut.OUTPUTTYPE = 2;
myeConnectOut.INDEX1FROM = DateTime.Now.AddDays(-5).ToString();
myeConnectOut.INDEX1TO = DateTime.Now.ToString();
myeConnectOut.FORLIST = 1;

How do I get a list of sales for x number of days?

*This post is locked for comments

  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: Using econnect to get list of sales orders?

    If you run the following SQL

    SELECT *

     FROM [dbo].[eConnect_Out_Setup]

    WHERE DOCTYPE='Customer'

    You will see the eConnect config for the requesters that are associated with the customer document type.

    Within that you probably have a "customer"  ALIAS row too.

    That row will then show what your index1 is, in this case, by default it would be INDEX1:CUSTNMBR

    The two posts below, if read will give an understanding of the way these are configured and how to make your own. This can be a headache if you are an ISV and need to ensure the config is intact after upgrades or protect the config from user tinkering... but not insurmountable.

    www.timwappat.info/.../eConnect-Requester-Documents-sourced-from-Custom-table-or-Views

    www.timwappat.info/.../Solution-to-eConnect-Requester-SOP-Transaction-trigger-not-creating-output-records

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Using econnect to get list of sales orders?

    Do you mean I have to search by SOP numbers, Order numbers or customer numbers and not search by dates?

  • Mick Egan Profile Picture
    Mick Egan 3,557 on at
    RE: Using econnect to get list of sales orders?

    Jamess,

    I believe the DOCTYPE = "Sales_Transaction", INDEX1FROM and INDEX1TO will equal a range of SOP Numbers, and INDEX2 = 2 for Order, and 3 for Invoice.

    Mick

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Using econnect to get list of sales orders?

    I have also tried "Sales_History_Transaction" and "Sales_Transaction" and neither work.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Using econnect to get list of sales orders?

    There was a typo in my post. Customers code is:

                   myeConnectOut.ACTION = 1;

                   myeConnectOut.DOCTYPE = "Customer";

                   myeConnectOut.OUTPUTTYPE = 2;

                   myeConnectOut.INDEX1FROM = this.custnumbr;

                   myeConnectOut.INDEX1TO = this.custnumbr;

                   myeConnectOut.FORLIST = 1;

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans