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

Disable XDS policy on a lookup

(0) ShareShare
ReportReport
Posted on by 190

Hello,

I have implemented an XDS policy on projTable for a certain role to view only projects with a specific type.

However, on the Timesheet screen I want to disable or bypass this policy so that the user with this role can add lines for all projects.

I tried doing this by extension on the lookup method of the formControl (on TSTimesheetEntry form):

public void lookup()
{
       unchecked(Uncheck::XDS)
       {
           next Lookup();

       }

}

But this is not working. On the timesheet lines I can see all project as intended but if I select one of the projects that is filtered out by my xds policy I get the error "Project ID ___ doesn't exist in the company ___. Select a valid project ID with respect to the legal entity specified in this timesheet line."

Is there any way to do this? Or am I missing something?

I have the same question (0)
  • ergun sahin Profile Picture
    8,826 Moderator on at

    This is the standard behavior of XDS, this is normal.

    You could try expanding a bit more where you typed "Uncheck" codes.

    I haven't tried it, but writing to modifield might do the trick. You can focus on Validates, or you can try to bypass XDS on the whole form by typing directly into the form's run method.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    303,716 Super User 2026 Season 1 on at

    Hi Oush,

    There is another workaround possible. You can create a new view based on the Project table and override the lookup() method to have an own lookup of projects using the view. As the view has another name, it is not restricted if it has not been setup as constrained table on your XDS policy.

  • rachelgomez Profile Picture
    on at

    To disable XDS policy in AX 2012 follow this steps

    xdsServices.setXDSState(0);

    However, this method does not exist in new AX any more. Now we need to wrap code where we want to disable XDS policy with unchecked(Uncheck::XDS)

    unchecked(Uncheck::XDS)

    {

       select ValidTimeState(_asOfDate) maxof(ValidTo) from hcmEmployment

           where hcmEmployment.Worker == _workerRecId;

    }

    Greeting,

    Rachel Gomez

  • Mariano Gracia Profile Picture
    on at

    I think your problem is that although you have skipped the XDS on the lookup, once the value is selected the validate field event is thrown, and once again your security policies are checked because the kernel evaluates the relation, you can't skip the validatefield event with extensions, so I think you'll have to look for another solution, maybe you could only restrict the projects in the main form?, I now it's annoying because it means the user will be able to query all the projects in the reports, wich are quickly restricted with XDS policies...

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans