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

(1) ShareShare
ReportReport
Posted on by 513
I created a security policy and I want the admin to run a batch that can disable it...
 
[SysOperationJournaledParametersAttribute(true)]
final class DYNADDVDisableBatch extends SysOperationServiceController
{
    public ClassDescription defaultCaption()
    {
        return "Disable Data Validation";
    }

    public void new()
    {
        super(classStr(DYNADataValidationClass),methodStr(DYNADataValidationClass,disableXDS),SysOperationExecutionMode::Synchronous);
    }

    public static DYNADDVDisableBatch construct(SysOperationExecutionMode _executionMode = SysOperationExecutionMode::Synchronous)
    {
        DYNADDVDisableBatch controller = new DYNADDVDisableBatch();
        controller.parmExecutionMode(_executionMode);
        return controller;
    }

    public static void main(Args _args)
    {
        DYNADDVDisableBatch controller = DYNADDVDisableBatch::construct();
        controller.parmArgs(_args);
        controller.startOperation();
    }

}
and this is disableXDS method code:
 
public void disableXDS()
    {
        unchecked(Uncheck::XDS)
        {

        }
    }
what's missing?!
I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    303,716 Super User 2026 Season 1 on at
    Hi,

    Can you elaborate on the business requirement? Enabling or disabling a policy can be done by the model ownder in Visual Studio. There are two options where non-admin users can bypass XDS policies. I wrote 2 blogs about that:
     
     
    In case you expect that all XDS policies are disabled by using the statement unchecked, then this is not working. The policies used when executing coding within the unchecked block will be bypassed. This unchecked statement is not a generic switch.
  • AbdullahAhmed_ Profile Picture
    513 on at
    So, what you mean is... The policy used in the Unchecked will be bypassed.. I have a policy that restrict access to all sales orders and I want the admin to turn it off across the whole system.
     
    So, I would use for example the salesTable in the Unchecked and  It should work fine?
  • André Arnaud de Calavon Profile Picture
    303,716 Super User 2026 Season 1 on at
    Hi Abdullah,

    No, this will not work. It will only disable coding in the block. If a user opens the sales orders, it is not part of the unchecked block and the policy remains active. Can you tell me if the policy is your customization or part of an ISV solution? If it is a customization, can you share some details of the policy and the related query linked to the policy?

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