In D365, is there a way to track who assigned a security role or change security role for other users.
Database logging is not turned on. So what are my options to trace these changes ?
Need your expert advice team !
Thanks
Thanks
Hi Bhav,
You can also do it by turning on Database logging on table "SecurityUserRole" (System administration -> setup -> Database log setup -> New ->SecurityUserRole under System Node)
Then you can track changes in System administration -> Inquiries -> Database -> Database log.
Hi, Bhav
You can also have a report to view the changes done to the user by duplicating the menuitem EePermissionChangesLog to support all legal entities (country region to be removed)
/Uday.
Hi Bhav,
You can CoC on the class "EePersonalDataAccessLogging" like following code.
[ExtensionOf(classStr(EePersonalDataAccessLogging))] final class EePersonalDataAccessLogging_extension { [SubscribesTo(formStr(SysSecRoleAssignOM), delegateStr(SysSecRoleAssignOM, userRoleChange))] public static void logUserRoleChange( RefRecId _securityRole, RefRecId _omInternalOrganization, UserId _userId, AddRemove _addRemove) { next logUserRoleChange(_securityRole,_omInternalOrganization,_userId, _addRemove); unchecked(Uncheck::TableSecurityPermission) { CompanyInfo companyInfo; EeUserRoleChangeLog log; boolean doInsert; int addCount; int removeCount; doInsert = true; if (doInsert) { //When we grant organizations, we have to turn off access to all //organizations. The application does this implicitly, but the //log will do it explictly. if (_omInternalOrganization && _addRemove == AddRemove::Add) { select firstOnly AddRemove, RecId from log order by log.recId desc where log.SecurityRole == _securityRole && log.OMInternalOrganization == 0 && log.UserId == _userId; if (log.recid && log.AddRemove == AddRemove::Add) { log.clear(); log.SecurityRole = _securityRole; log.omInternalOrganization = 0; log.UserId = _userId; log.AddRemove = AddRemove::Remove; log.ChangedBy = curUserId(); log.insert(); } } log.clear(); log.SecurityRole = _securityRole; log.omInternalOrganization = _omInternalOrganization; log.UserId = _userId; log.AddRemove = _addRemove; log.ChangedBy = curUserId(); log.insert(); //When we revoke access to the last organization, they have implicit //access to all organizations. The log will do this explictly. if (_omInternalOrganization && _addRemove == AddRemove::Remove) { while select AddRemove, RecId from log order by log.recId desc where log.SecurityRole == _securityRole && log.OMInternalOrganization != 0 && log.UserId == _userId { if (log.AddRemove == AddRemove::Add) { addCount++; } else { removeCount++; } } if (addCount == removeCount) { log.clear(); log.SecurityRole = _securityRole; log.omInternalOrganization = 0; log.UserId = _userId; log.AddRemove = AddRemove::Add; log.ChangedBy = curUserId(); log.insert(); } } EePersonalDataAccessLogging::logSecurityRightsChange(_securityRole, _userId, _addRemove, _omInternalOrganization); } } } }
After building, and modify roles on a user, we can see the changes are tracked in table "EeUserRoleChangeLog".
Hi. Bhav
It is possible in AX 2012 to review the changes being made to the security roles and similarly this works in Dynamics 365 FO as well
blogs.msdn.microsoft.com/.../dynamics-ax-2012-audit-of-security-role-membership-changes
/Uday.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156