web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Bypass the limited access to legal entities in "Assign Organizations" for user roles

(0) ShareShare
ReportReport
Posted on by 9,066 Super User 2026 Season 1
Hi

As you know in SysAdmin form, I can assign organization for a user role. This will cause the user to only see data for the organization he/she has access to.

Is there a way I can bypass this restriction?


Here's my scenario:

I created a form with three grids:


left grid, should show all companies (even if it was specified in /Assign organization/ that the user can't see specific companies), how can I do that? because currently it's showing only the companies that the user has access to and not all of them.

middle grid, should show the sites for the company I selected in the first grid

third grid, should show the addresses for the site selected in the second grid.

 
 
Here is the form datasources:
 
 
 
LogisticsLocation:/Link Type/= Delayed, / Cross Company Auto Query/ = No
LogisticsPostalAddress : OuterJoin with LogisticsLocation, / Cross Company Auto Query/ = No
CompanyInfo:  /Link Type/= Delayed, / Cross Company Auto Query/ = Yes
InventSite: /Link Type/= Delayed, / Cross Company Auto Query/ = Yes
 
Here is the code for the datasources:
 
  [DataSource]
    class CompanyInfo
    {
        public void init()
        {
            super();
            this.query().dataSourceTable(this.table()).clearDynalinks();
        }
        public int active()
        {
            int ret;
            Query query = InventSite_ds.query();
            query.clearCompanyRange();
            query.addCompanyRange(CompanyInfo.DataArea);
            InventSite_ds.executeQuery();
            element.executeQueryLogisticsLocation(tableNum(InventSite));
            ret = super();
           
            return ret;
        }
        /// <summary>
        /// Execute query of CompanyInfo DataSource
        /// </summary>
        public void executeQuery()
        {
            Query                query = new Query();
            QueryBuildDataSource qbdCompany;
            query.allowCrossCompany(true);
            qbdCompany = query.addDataSource(tableNum(CompanyInfo));
            element.addRangeToCompanies(qbdCompany);
            this.query(query);
            super();
            if(buyingLegalEntity)
            {
                CompanyInfo_ds.positionToRecord(CompanyInfo::findRecId(buyingLegalEntity));
            }
 
        }
    }
    [DataSource]
    class InventSite
    {
        public void init()
        {
            super();
            this.query().dataSourceTable(this.table()).clearDynalinks();
        }
        public int active()
        {
            int   ret;
            element.executeQueryLogisticsLocation(tableNum(InventSite));
            ret = super();
           
            return ret;
        }
    }
 
 
 
I have the same question (0)
  • GirishS Profile Picture
    27,833 Moderator on at
    Hi Waed,
     
    For the first grid I would suggest you to create a table for that and insert all the companies details to that table - Use that table as a DataSource inside the form.
     
    Thanks,
    Girish S.
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    303,347 Super User 2026 Season 1 on at
    Hi Waed,

    The contents of the CompanyInfo table are not restricted based on the organization assignment, unless you have a security policy (XDS) implemented on this table. You can try to remove the statement with addCompanyRange as this is setting additional security.
     
    Otherwise, the current behavior can be caused by the table InventSite as this table has a field to keep data separate per legal entity. Even though you have set this table to run cross-company, the security framework will apply security filters per legal entity. 
     
    In case you have an XDS policy on the CompanyInfo table, you can bypass that by creating a view with the CompanyInfo table as data source.
     
  • Waed Ayyad Profile Picture
    9,066 Super User 2026 Season 1 on at
    Hi Andre,

    " You can try to remove the statement with addCompanyRange as this is setting additional security."==== But I want to get the data from Invent site based on the active company 
     
     Query query = InventSite_ds.query();
    query.clearCompanyRange();
     query.addCompanyRange(CompanyInfo.DataArea);
     
    "the security framework will apply security filters per legal entity. " === Here you mean the restriction on security level will only return data from unrestricted legal entities? 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 509 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 375

#3
Adis Profile Picture

Adis 268 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans