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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How do I implement an XDS policy to restrict worker visibility

(1) ShareShare
ReportReport
Posted on by 2

How do I implement an XDS policy to restrict worker visibility to specific operating units without throwing caching errors?

Categories:
I have the same question (0)
  • Verified answer
    SajeedMullaji Profile Picture
    478 on at

    xds caching errors on HcmWorker and related HR tables are caused by three specific issues — here is how to implement the policy correctly and avoid each one:
    Root causes of caching errors:
    HcmWorker has aggressive kernel caching (CacheLookup = Found or EntireTable) — when XDS filters the initial result the AOS caches that filtered set and serves stale records as the user navigates across operating unit contexts
    Heavy SQL operations inside the xds() method cause kernel timeout exceptions on every row fetch
    Unindexed joins in the XDS query predicate break kernel query caching plans
    Correct implementation:
    Create a secure mapping table (e.g. MyUserOperatingUnitSecurity) with UserId and OperatingUnitId. Use this as your XDS primary table, linked to HcmWorker via standard department or position relations.
    Implement the context method cleanly:

    public static server str findUserOperatingUnitXDS()

    {

        MyUserOperatingUnitSecurity userUnitSecurity;

        str filterString;

        while select userUnitSecurity

            where userUnitSecurity.UserId == curUserId()

        {

            if (filterString)

                filterString += ',';

            filterString += int642Str(userUnitSecurity.OperatingUnitId);

        }

        if (!filterString)

            filterString = '-1'; // deny unassigned access safely

        return filterString;

    }

    three rules to prevent caching errors:

    never use aggressive static caching on tables constrained by XDS — forms depending on those tables must not cache filtered result sets across operating unit context changes

    Always run full database synchronization and clear server cache after modifying any XDS policy

    During troubleshooting assign the built-in XDSDataAccessPolicyBypassRole to isolate whether missing data is an XDS caching issue or a standard security privilege gap — this tells you immediately which layer the problem is in

    If it helps,Mark answered.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
SajeedMullaji Profile Picture

SajeedMullaji 419

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 271 Super User 2026 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 271 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans