Skip to main content

Notifications

Community site session details

Community site session details

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

Disable record level security on a form in X++

(0) ShareShare
ReportReport
Posted on by 1,424

Is there a way to disable record level security on a single form in X++? I tried doing the following on form datasource executeQuery method but it didn't work:

formDatasource_ds.query().recordLevelSecurity(false);
formDatasource_ds.queryRun().recordLevelSecurity(false);

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    294,000 Super User 2025 Season 1 on at
    RE: Disable record level security on a form in X++

    Hi Muhammad,

    Are the tables on the datasource also used on other forms and part of the XDS policy?

    Another workaround would be creating a new view with the contents of the table you want to show unrestricted. The view is considered as a new table name and in this way you can bypass the XDS policy on the original table.

  • Sergei Minozhenko Profile Picture
    23,091 on at
    RE: Disable record level security on a form in X++

    Hi Muhammad,

    In this case, you need to consider if SaveDataPerCompany parameter. If it's enabled on the table used on the form, you need to activate cross-company selects.

    q.allowCrossCompany(true);

  • M Anas Khan Profile Picture
    1,424 on at
    RE: Disable record level security on a form in X++

    Hi Ludwig,

    Yes you are correct. This is kind of a contracting business requirement! There is custom inquiry form which should be global (cross-company), showing records from all companies. At the moment, customer assigns organisations at the user role level to restrict access to limited companies for a user. However for this particular form they want users to see data from all companies.

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: Disable record level security on a form in X++

    Hello Muhammad,

    That is an interesting request. If I read this thread I wonder why you need XDS but not for a specific form? Is this an exception for a specific group of people that can use the form or what is the reasoning behind?

    Just curious ... :-)

    Ludwig

  • Blue Wang Profile Picture
    on at
    RE: Disable record level security on a form in X++

    Hi Muhammad Anas Khan ,

    Record-level security is bypassed in the following situations:

    1,Using display and edit methods

    2,Using FormListControl, FormTreeControl or TableListControl to show data

    3,Using a temporary table as a data source

    docs.microsoft.com/.../record-level-security

  • André Arnaud de Calavon Profile Picture
    294,000 Super User 2025 Season 1 on at
    RE: Disable record level security on a form in X++

    Hi Muhammad,

    Like Sergei mentioned, you can try the init method on the datasource or the form.

    There is also another command which can be used to enable or disable XDS: XDSServices.setXDSState

  • Sergei Minozhenko Profile Picture
    23,091 on at
    RE: Disable record level security on a form in X++

    Hi Muhammad,

    Have you tried to apply this code in the data source init method?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 232,850 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans