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

Notifications

Announcements

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 493
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
    301,536 Super User 2025 Season 2 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
    493 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
    301,536 Super User 2025 Season 2 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

News and Announcements

Season of Giving Solutions is Here!

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
Abhilash Warrier Profile Picture

Abhilash Warrier 763 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 284 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans