Sometimes when I try to delete certain User groups in Dynamics AX 4.0 or Dynamics AX 2009 I notice that the User groups disappears from the Grid but is actually not deleted.
When I am clicking at the delete button the first thing I notice is that the delete operation takes a rather long time and during this time the Dynamics AX Client is hanging (not responding). After the operation is finished and the AX Client "back alive" the User group is no longer showing up in the Grid, but when I am refreshing the Grid or closing and reopening the User group Form the deleted User group showes up again.
The reason why certain User groups cannot be deleted are no longer valid records in the SysSRSTablePermissions table. In this table a record per AX Domain, AX User group and AX Secure View is stored. If a table, a SSRS Secure View is based on, was deleted from the AOT it can happen that the correspond record it is still present in this system table.
During the removal of a User Group the SSRS Secure Views are refreshed too. If during this synchronization process of the SSRS Secure Views a table is accessed that cannot be found in the AOT the synchronization process is terminated. The termination follows a ttsabort, causing the whole database transaction being rolled back. Therefore the User group is not deleted.
In order to successfully delete the User group the no longer valid records have to be removed from the SysSRSTablePermissions table.
By following these steps, all records of the SysSRSTablePermissions table are updated for the selected User group:
If you just want to find out if there are any no longer valid records in the SysSRSTablePermissions table you can run the following X++ job: