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

Any Reason why ReadMultiple web method would return 0 records

(0) ShareShare
ReportReport
Posted on by 14,065

I have an integration that calls the ReadMultiple method of the Customer web service. There are 2 NAV databases that are supposed to be configured the same, and with similar data. However, in one database the ReadMulitple returns data as expected, but in the other database the method returns 0 records, even with no filters applied. No errors are returned.

I'm only consuming the web services, and have little knowledge of NAV, but would like to know what could cause this behaviour. Could it be part of the web service configuration, or permissions, or is there anything I can test further ?

This is NAV 2009

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Are you getting any error ? Are you querying the right company because in Navision you can have multiple companies and in your URL you need to specify the company name, make sure the company name in URL matches to the company name in the other database.

  • David Jennaway Profile Picture
    14,065 on at

    Thanks for the reply. We get no error from the call. We did initially get an error 'You do not have the following permissions on CodeUnit ApplicationManagement: Execute’, but the account was then granted permissions in NAV, and we no longer get the error.

    The company name might be the issue - the url we were given below includes a '.' in the name ('ABC%20LTD.') which looks a bit suspicious, and the working environment doesn't have a '.' in the name - I'll check what happens without the '.', or if I can escape it in the url

    abcsqlserver.abc.local/.../ABC_CRM_CUSTOMER

  • David Jennaway Profile Picture
    14,065 on at

    Just checked, and the company name doesn't seem to be the problem - we get the same behaviour with or without the '.', and with another company in the database. And trying a deliberately wrong company name throws an http 500 error

    Any other ideas ?

  • Suggested answer
    Alexander Ermakov Profile Picture
    28,096 on at

    This operation does not throw faults when no matching records are present. Instead, it returns an empty record list. It might be caused by the error in C/AL code. Do you have access to NAV? Try receive the last record by setting SetSize to -1 - what would happen?

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Did you try using Read Operation to read a single customer ? Does it retrieve the customer ?

  • David Jennaway Profile Picture
    14,065 on at

    Thanks for the replies. With SetSize = -1 I still get no records, and the Read operation returns null. Again, no errors in either case.

    I don't have access to NAV (it's maintained by a 3rd party, who I can ask to check things, if there's anything you can suggest ?), but can access the SQL database (though I don't have rights to enable SQL tracing)

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    From SQL can you open that company table and check if it has any records ?

  • Verified answer
    David Jennaway Profile Picture
    14,065 on at

    Thanks all for your help. In the end the issue was with the case of the web service name. In Test it was defined as ABC_CRM_Customer, but in Live it was ABC_CRM_CUSTOMER. This affects the case of the XML elements, and the wrapper that the .Net calling code applies was ignoring elements with the wrong case.

    Due to the code structure, the easiest resolution for this was a find/replace in the reference.cs file that's generated in VS for a Service Reference, and also find/replace in the code files that used the service reference. The one final part of this fix was to ensure we still used the correct ConfigurationName in the ServiceContractAttribute

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans