Показать сообщение отдельно
Старый 22.06.2014, 01:19   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: How to deactivate security policy in AX 2012 RTM for a query only due to tuning performance
Источник: http://blogs.msdn.com/b/axsupport/ar...rformance.aspx
==============

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.

///

///

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

///

///

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

///

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;

}




Источник: http://blogs.msdn.com/b/axsupport/ar...rformance.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.