Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / How to add cross compa...
Finance forum

How to add cross company in Odata URI

(0) ShareShare
ReportReport
Posted on by

Hi,

I am using the Odata service application to fetch the data from the dynamics 365 FO and successfully authenticate all credential like (App Id/ Secret key and tenant key)

When I try to fetch the data from customer data entities I am not getting any result when I checked the URL the cross-company = true is not added.

Current URL which is processing is :
https://crm365develope80754a0238c7b1edevaos.cloudax.dynamics.com/Data/Customers
Which is wrong as I am not getting any data from above url .
Correct URL should be :
https://crm365develope80754a0238c7b1edevaos.cloudax.dynamics.com/Data/Customers?cross-company=true

So how we append the cross-company using Odata Service Application (downloaded from GitHub)

-- Function
 public static void GetCustomerFilterByCompany(Resources d365)
        {
            var customer = d365.Customers;           
            foreach (var record in customer)
            {
                Console.WriteLine("Customer Name : {0}", record.Name);
            }
        }

  • Community Member Profile Picture
    on at
    RE: How to add cross company in Odata URI

    Thanks Martin. It's work for me :)

  • Verified answer
    Martin Dráb Profile Picture
    232,996 Most Valuable Professional on at
    RE: How to add cross company in Odata URI

    d365.Customers.AddQueryOption("cross-company", "true") should do the trick.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,996 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans