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)

eConnect and getting data in batches

(1) ShareShare
ReportReport
Posted on by 220

I am using eConnect to get Item data.  The call is pretty basic, and looks like this:

using (var e = new eConnectMethods())

            {

                ret.LoadXml(e.GetEntity(_connectionString, eConnect_Request_XML));

                e.Dispose();

            }

 

The eConnect_Request_XML looks like this:

<eConnect xmlns:dt="urn:schemas-microsoft-com:datatypes">

  <RQeConnectOutType>

    <eConnectProcessInfo>

      <Outgoing>TRUE</Outgoing>

      <MessageID>Item</MessageID>

    </eConnectProcessInfo>

    <eConnectOut>

      <DOCTYPE>Item</DOCTYPE>

      <OUTPUTTYPE>2</OUTPUTTYPE>

      <FORLOAD>0</FORLOAD>

      <FORLIST>1</FORLIST>

      <ACTION>0</ACTION>

      <ROWCOUNT>0</ROWCOUNT>

      <REMOVE>0</REMOVE>

    </eConnectOut>

  </RQeConnectOutType>

</eConnect>

 

Because there are close to 18,000 items, this call times out and throws an OutOfMemory Exception, which also causes eConnect to max out on memory and not release it.

My question is how can I get all items, using eConnect, in batches?  I'm aware of the index to and index from property, but not sure how to implement it in a looping fashion.

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Jon Stalnaker Profile Picture
    220 on at

    I'm using this call to get the first 5 items

    <eConnect xmlns:dt="urn:schemas-microsoft-com:datatypes">

     <RQeConnectOutType>

       <eConnectProcessInfo>

         <Outgoing>TRUE</Outgoing>

         <MessageID>Item</MessageID>

       </eConnectProcessInfo>

       <eConnectOut>

         <DOCTYPE>Item</DOCTYPE>

         <OUTPUTTYPE>2</OUTPUTTYPE>

         <FORLOAD>0</FORLOAD>

         <FORLIST>1</FORLIST>

         <ACTION>0</ACTION>

         <ROWCOUNT>5</ROWCOUNT>

         <REMOVE>0</REMOVE>

       </eConnectOut>

     </RQeConnectOutType>

    </eConnect>

    Then I'm trying to take the last item number and use the following XML to get the next 5 but it returns an empty set.  009990000020 is a valid itemnumber that was returned from the data.

    <eConnect xmlns:dt="urn:schemas-microsoft-com:datatypes">

     <RQeConnectOutType>

       <eConnectProcessInfo>

         <Outgoing>TRUE</Outgoing>

         <MessageID>Item</MessageID>

       </eConnectProcessInfo>

       <eConnectOut>

         <DOCTYPE>Item</DOCTYPE>

         <OUTPUTTYPE>2</OUTPUTTYPE>

         <INDEX1FROM>009990000020</INDEX1FROM>

         <FORLOAD>0</FORLOAD>

         <FORLIST>1</FORLIST>

         <ACTION>0</ACTION>

         <ROWCOUNT>5</ROWCOUNT>

         <REMOVE>0</REMOVE>

       </eConnectOut>

     </RQeConnectOutType>

    </eConnect>

    What is frustrating is that if I use the following XML, I get the first 5 items again

    <eConnect xmlns:dt="urn:schemas-microsoft-com:datatypes">

     <RQeConnectOutType>

       <eConnectProcessInfo>

         <Outgoing>TRUE</Outgoing>

         <MessageID>Item</MessageID>

       </eConnectProcessInfo>

       <eConnectOut>

         <DOCTYPE>Item</DOCTYPE>

         <OUTPUTTYPE>2</OUTPUTTYPE>

         <INDEX1TO>009990000020</INDEX1TO>

         <FORLOAD>0</FORLOAD>

         <FORLIST>1</FORLIST>

         <ACTION>0</ACTION>

         <ROWCOUNT>5</ROWCOUNT>

         <REMOVE>0</REMOVE>

       </eConnectOut>

     </RQeConnectOutType>

    </eConnect>

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