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 AX (Archived)

Limited records (1000) returned by document service 'EcoResProductService'

(0) ShareShare
ReportReport
Posted on by 125

I am consuming the default web service 'EcoResProductService'  in AX 2012. When I run the web service it returned only 1000 records, is there any way to get more than 1000 records, in AX table there are 22000 records actually. 

I have tried to add value mapping check box to be CHECKED and set Max. Number of documents to 100000 from 1000. Inbound Port properties > Processing options > Value mapping > setup > Limitations type > Specified > Set max. number of documents. 

I have also increased message buffer size, readerQuota, timeout bindings in app.config

Can anyone suggest?

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at

    It's a limit for a single message, not a limit of the service itself. Trying to get such a huge number of documents in a single message doesn't sound like a good idea, because you can easily run into timeouts and other limits, it consumes a lot of resources, resending the message (if something fails) is expensive and so on.

    Why do you require to get everything in a single message, instead of using several smaller messages?

  • Luqman Profile Picture
    125 on at

    I want to get the list of all created products in the system, "DisplayProductNumber" field  EcoResProduct table contains my required information.

    This field is holding the name of the product (name cosists of dimensions and product name)

  • Verified answer
    Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at

    You haven't mention any requirement about a single message, therefore stop trying to do that. It's a bad idea.

    If you want an advice, don't use document service for this requirement. Use a query service - it will be much faster and it directly supports paging.

  • Luqman Profile Picture
    125 on at

    I couldn't got your point "requirement about a single message"...My bad :) I am not so deep in working with aif services.

    Thanks for suggestion on "query service". Can you guide me a little more on query service, or that would be great if you can share any link or blog where I can look and execute an example for creating and consuming "Query service".

  • Suggested answer
    Community Member Profile Picture
    on at

    Please check the following link : www.dynamics101.com/.../creating-custom-inbound-aif-service-microsoft-dynamics-ax-2012

    This contains an example of fetching customers.

  • Suggested answer
    Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at

    http://lmgtfy.com/?q=ax+2012+query+service

  • Verified answer
    Chris Haley Profile Picture
    on at

    I agree with previous comments that the AIF is not a suitable way to extract large amounts of data from AX, but for the sake of completeness, I have seen this issue before and we found a couple of quick workarounds:

    1. Be a system administrator in AX

    2. Modify a macro value defined in the AX code

    Option 1: The problem is caused by a permissions issue. There is a method: AxdBaseRead\findLimitOnDocument() which looks up the details of the outbound port setup when creating the outbound message. If the user doesn't have permissions to read that setup (where you specified the max document limit) then the method will use a macro value which is hard coded.. Which leads to option 2:

    The 1000 record limit you are hitting is specified as a macro, which is defined in the class declaration of the AxdBaseRead class.

    You can increase the limit here, do X++ and CIL compile and the issue goes away:

    #define.MaxNumberOfDocuments(100000)

  • Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at

    I never said that "AIF is not a suitable way to extract large amounts of data". I said that trying to use a single message for 22000 documents is a bad idea. It's not the same.

    A single message can't have an infinite size, therefore any scalable solution must support splitting to several SOAP messages.

  • Luqman Profile Picture
    125 on at

    Thanks chris. I increased the macro value to different figures from 1200. It did returned 1200 records, but when i set the value to 100000, my console application stopped and thrown inner exceptions like "More data was expected, EOF was reached." 
    Well, I went for query service  as Martin suggested and that worked well enough. Thanks

  • NabD59 Profile Picture
    20 on at

    After looking for a solutiion, I found that instead of changing value in code for AxdBaseRead>findLimitOnDocument and increasing the #define.MaxNumberOfDocuments(1000),  there's a parameter.

    In the AIF bound port > Processing Options > Value Map Group > Check the options and click on the AifEndpointActionValueMap button.

    The AifEndpointActionValueMap form will open then go to the Setup Tab > in the Outbound Properties group, you can find parameters used for the AIF service. And when modifying this parameter, the impact will only concern this service.

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans