web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 391
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)
  • André Arnaud de Calavon Profile Picture
    297,231 Super User 2025 Season 2 on at
    Disable XDS policy
    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?
  • AbdullahAhmed_ Profile Picture
    391 on at
    Disable XDS policy
    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?
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    297,231 Super User 2025 Season 2 on at
    Disable XDS policy
    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.

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

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

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 665 User Group Leader

#2
Martin Dráb Profile Picture

Martin Dráb 595 Most Valuable Professional

#3
Yng Lih Profile Picture

Yng Lih 558

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans