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)

Cross company view

(1) ShareShare
ReportReport
Posted on by 3,542

I need a cross company view of some table. (For reasons)

I read somewhere on Microsoft docs that a view cannot be cross company. Is that correct? (I tried finding my source without success.)

If I am correct, my second question is:

2) Why is that property available? For reference: On the node View Metadata there is a property Allow Cross Company.

Then I solved this apparent issue by creating a view, ViewA of QueryA with TableA as root datasource. Then I created a cross company query of ViewA, ViewAQueryCrossCompany. And then a view of the last mentioned query. Is there a "better" solution? (As I created two views and a two queries of TableA, just to get one View.)

I am new to Views, very limited experience..... (Yes I have read the Microsoft docs page.) So maybe I'm not getting something. And maybe my question is "wrong". The point is as I mentioned in the first line, I need a cross company view of tableA.

Thanks for reading

*This post is locked for comments

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Please see this documentation: [View:https://docs.microsoft.com/en-us/dynamicsax-2012/developer/cross-company-queries-for-views]

    A view can allow cross company queries, but just like with tables, the cross company "intention" must be explicitly specified when reading from the view.

    In your case, I guess you could just forget about the view and create a cross company query / select statement into your table.

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

    This is the normal usage:

    Create a view Allow Cross Company = True and when you're using the view, query it in the same way as if you're using a table and you want to get cross-company behavior. For example, use Cross Company Auto Query in a form, crossCompany keyword in select statements etc. It's really the same as using tables.

    What situation are you in that you can't do it this way?

  • Pete Alberts Profile Picture
    3,542 on at

    Thanks Nikolaos Mäenpää, that was the page I was referring to.

    Martin I think I get it (I need to get used to the fact that a view is more or less a table).

    I have been tasked with a cash flow add-in. (Yes there is existing cash-flow functionality - I'm just following orders from the boss.)

    What my boss wants is a list of records that influence cash flow. It needs to be able to "Open in excel" and real time. In other words the source needs to be a query. And I need an entity for "Open in Excel" and for that I need a view. I am working with a bunch of things that are new to me, so I am scared that the cross-company part gets lost somewhere down the line.

    For example I have queries for all the relevant tables, then views for those queries (to create some Computed Columns), then a union query to join all the views;;;; then a view of the union query and finally an entity of that view. And on all the elements there is the Cross-Company option - so I was scared that the fact that views cannot be cross-company (what I previously incorrectly understood) will jeopardise the whole operation. But I understand now.... :)

    Thanks all.

  • Pete Alberts Profile Picture
    3,542 on at

    Last question.

    Martin you mentioned that "... Allow Cross Company = True and when you're using the view ... ". Does this imply that if I cross-company query a view that has the property set to "no", I will not get the desired results or will a cross company query of a view be cross company regardless of the mentioned property?

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

    Yes, "Open in Excel" is based on data entities and therefore not a query. Therefore you want an entity with cross-company behavior. It would have helped if you mentioned it at the beginning.

    The documentation is again able to help. Please check out Development for data entities > Cross-company behavior

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