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:

  1. Open the Administration | Setup | User groups Form
  2. Select the User group you want to delete in the Grid
  3. Click at the Permissions button
  4. Repeat the following steps for all exiting Domains
    1. Select the Domain in Domains List
    2. Change to the Permissions tab
    3. Select any Security Key and make any change to the Access level (e. g. change from No access to View)
    4. Undo the change you did in the previous step (e. g. change back from View to No access)
    5. Save the changes and go back to the Overview tab
  5. After all Domains were touched close the User group permissions Form
  6. Back in the User groups Form you can now continue deleting the 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:

static void CheckSRSTablePermissions(Args _args)
{
    SysGroup groupName;
    SysSRSTablePermissions srsp;
    DictTable dictTable;
    int validTables = 0;
    int invalidTables = 0;
    ;
 
    //////////////////////////////////////////////
    //This is the name of the group to check for//
    groupName = 'Group1';
    //////////////////////////////////////////////
 
    info(strFmt('CheckSRSTablePermissions: Checking SRS Tables for Group \'%1\'!', groupName));
 
    while select srsp where srsp.GroupId == groupName
    {
        dictTable = new DictTable(srsp.TabId);
 
        if (!dictTable)
        {
            invalidTables++;
            warning(strFmt('Tha Table with the ID 0x%1 does not exit!', int2hex(srsp.TabId,4)));
        }
        else
            validTables++;
    }
 
    if(validTables + invalidTables > 0)
        info(strFmt('CheckSRSTablePermissions: %1 Tables are valid, %2 Tables are invalid', validTables, invalidTables));
    else
        warning('CheckSRSTablePermissions: No Tables were found!');
}

 

--author: Alexander Lachner
--editor: Alexander Lachner
--date: 29/07/2009