Skip to main content
Post a question

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Cross company view

Like (1) ShareShare
ReportReport
Posted on 25 Aug 2018 08:00:58 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

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,476 Most Valuable Professional on 25 Aug 2018 at 12:40:09
    RE: Cross company view

    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

  • Pete Alberts Profile Picture
    Pete Alberts 3,542 on 25 Aug 2018 at 12:06:38
    RE: Cross company view

    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?

  • Pete Alberts Profile Picture
    Pete Alberts 3,542 on 25 Aug 2018 at 12:01:28
    RE: Cross company view

    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.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,476 Most Valuable Professional on 25 Aug 2018 at 09:40:09
    RE: Cross company view

    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?

  • Verified answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on 25 Aug 2018 at 09:23:42
    RE: Cross company view

    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.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,784 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading complete