AX – D365FO – X++ code to find all the Duties related to specific Privileges in AX 2012

static void findAllTheDutiesForSpecificPrivileges(Args _args) { SecurityTask securityTask; SecuritySubTask securitySubTask; #define.SecurityTask("AbbreviationCodeImport_Import_RU") // your privileges name select firstOnly RecId from securityTask where securityTask.AotName == #SecurityTask && securityTask.Type == SecurityTaskType::Privilege; while select SecurityTask from securitySubTask where securitySubTask.SecuritySubTask == securityTask.RecId { select firstOnly * from securityTask where securityTask.RecId == securitySubTask.SecurityTask; info(strFmt(“%1,%2,%3″, securityTask.AOTNAME, securityTask.Name, securityTask.Type)); } }

AX – D365FO – X++ Code to find all the privileges for a menu item in AX

Create this job to find all the privileges for a menu item static void findAllThePrivilegeForSpecificMenuItem(Args _args) { SecurityTask securityTask; SecuritySubTask securitySubTask; SecurityTaskEntryPoint securityTaskEntryPoint; SecurableObject securableObject; while select * from SecurityTaskEntryPoint join SecurableObject where SecurableObject.RecId == SecurityTaskEntryPoint.EntryPoint && SecurableObject.Name == menuitemOutputStr(TaxReport_IT_ERA) //your menu item { while select * from securityTask where securityTask.RecId == SecurityTaskEntryPoint.SecurityTask { info(strFmt("%1,%2,%3,%4", … Continua a leggere AX – D365FO – X++ Code to find all the privileges for a menu item in AX