Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / ShabibAX / bypass or disable extensibl...

bypass or disable extensible data security (xds) policy on runtime AX2012 and Dynamics 365 For Finance and Operations

Shabib raza Profile Picture Shabib raza 129

In this blog i will show you how to bypass or disable extensible data security (xds) policy on runtime in Dynamics AX 2012 and Dynamics 365 for Finance and Operations.

The scenario is to get all records of warehouse on lookup which is already filtered through applied XDS on user.

AX2012

XDSServices xdsService = new XDSServices();

xdsService.setXDSState(0);

SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventLocation), _ctrl);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;

queryBuildDataSource = query.addDataSource(tableNum(InventLocation));

sysTableLookup.addLookupfield(fieldNum(InventLocation, inventlocationid));
sysTableLookup.addLookupfield(fieldNum(InventLocation, Name));

sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();

Dynamics 365 for Finance and Operations

unchecked(uncheck::XDS)
{
     SysTableLookup       sysTableLookup = sysTableLookup::newParameters(tableNum(InventLocation), _ctrl);
     Query                query = new Query();
     QueryBuildDataSource queryBuildDataSource;
            
     queryBuildDataSource = query.addDataSource(tableNum(InventLocation));

     sysTableLookup.addLookupfield(fieldNum(InventLocation, inventlocationid));
     sysTableLookup.addLookupfield(fieldNum(InventLocation, Name));

     sysTableLookup.parmQuery(query);
     sysTableLookup.performFormLookup();
}

Thanks,
Happy Coding

Comments

*This post is locked for comments

  • Nastaran Profile Picture Nastaran 288
    Posted at
    @raj because unchcking XDS is applied only on codes in the body. for this aim I think you should disable XDS when menu item wants run
  • rajeev tiwari Profile Picture rajeev tiwari 410
    Posted at
    In D365 Finance and operations .. after using your code it shows all warehouses but after selecting it gives validation message "The value 'DAM' in field 'To warehouse' is not found in the related table 'Warehouses'." and it means still XDS gets applied. how can we make this working , do you have any idea ??