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 :

How to deactivate security policy in AX 2012 RTM for a query only due to tuning performance

Dynamics AX Support Profile Picture Dynamics AX Support Microsoft Employee

Here is an example on how to increase performance by temporarily deactivating a query used to show open vendor invoices:

Open table Table VendTrans in AOT and expand methods and customize the method existsVendPaymReconciliationImport_SEBG() as follows:

///

/// This source code is freeware and is provided on an "as is" basis without warranties of any kind,

/// whether express or implied, including without limitation warranties that the code is free of defect,

/// fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of

/// the code is with the end user.

///

/// <summary>

/// Determines if the <c>VendPaymReconciliationImport_SEBG</c> is being used as a return format on an open vendor invoice.

/// </summary>

/// <returns>

/// True if the <c>VendPaymReconciliationImport_SEBG</c> is being used as a return format on an open vendor invoice.

/// </returns>

public static boolean existsVendPaymReconciliationImport_SEBG()

{

VendTrans vendTrans;

VendTransOpen vendTransOpen;

VendPaymModeTable vendPaymModeTable;

boolean isFound;

//MSFT Support - 2 lines added to bypass GAB security

XDSServices xds = new XDSServices();

#DirParty

//MSFT Support - 1 line added below, bypass GAB security.

xds.setXDSContext(0, #InvalidContextString);

select firstonly RecId from vendTransOpen

exists join vendTrans

where vendTrans.RecId == vendTransOpen.RefRecId

exists join vendPaymModeTable

where vendPaymModeTable.PaymMode == vendTrans.PaymMode

&& vendPaymModeTable.ClassIdReturn == classNum(VendPaymReconciliationImport_SEBG);

// 1 line added below, revert back the security

xds.setXDSContext(0, '');

isFound = (vendTransOpen.RecId != 0);

return isFound;

}

Comments

*This post is locked for comments