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 :
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);

I have the same question (0)
  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi Muhammad,

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

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    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

  • Blue Wang Profile Picture
    on at

    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

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    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

  • M Anas Khan Profile Picture
    1,424 on at

    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.

  • Sergei Minozhenko Profile Picture
    23,093 on at

    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);

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    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.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans