How to get OData URLs with company names that contain forward slashes


Customers who want to consume Dynamics NAV data with OData in Microsoft Excel and have company names such as CRONUS A/G or CRONUS Danmark A/S may find it difficult or result in an error. When connecting to an OData feed from Excel, this does not work unless you don’t specify a Company Name in the connection string and set the company as a "Services Default Company" on the Dynamics NAV Server instance.

In other words, if you have multiple companies that have "A/S" as part of the company name in the same database and only one Dynamics NAV Server instance are unable to connect from Excel.

By default, an OData URL would look something like this:

https://demoserver.domain.com:7048/DynamicsNAV110/ODataV4/Company('CRONUS%20Danmark%20A%2FS')/VendorLedgerEntries

Here's how to get the connection to work: Include the company name into the query string instead of the OData path:

https://demoserver.domain.com:7048/DynamicsNAV110/ODataV4/VendorLedgerEntries?company='CRONUS%20Danmark%20A%2FS'

Another example with a filter:

https://demoserver.domain.com:7048/DynamicsNAV110/ODataV4/SalesOrder?company='CRONUS%20Danmark%20A%2FS'&$filter=Document_Type eq 'Order' and No eq '1256' and Bill_to_Name eq 'ABC/D'

This workaround also applies to other applications and not just Microsoft Excel.

Thank you,
Mohamad Vajid
Microsoft Dynamics NAV

 

Comments (4)

  1. Pallea says:

    Well, you are right.. BUT I think there is one solution that is much better for everyone – and does not require any special ninja-tricks…

    Simply avoid using / # and special chars in the company name. I suggest my customers to create the company as Cronus Danmark and in display name as Cronus Danmark A/S..

    Start NAV, Search for Companies, EDIT the company and remove the A/S wait a few minutes, and change the Display Name field to whatever you want to have shown everywhere in the client…

    This method was added to NAV some time ago – especially to avoid the difficulties with ODATA and SOAP.

  2. In general, is such a workaround necessary and available for SOAP URLs too?

    1. Pallea says:

      Hi @Natalie!

      Yes, SOAP has exactly the same problem! For months I reported the problem that SOAP and ODATA didn’t work when NAV2013 was released. And every time got the response that I was wrong. Eventually i figured out that the problem was the / (forward slash).

      After months of discussions the solution with Display Name in the Companies table was choosen.

  3. Anonymous says:
    (The content was deleted per user request)
Skip to main content