Resolving: The record you requested has been deleted or you may not have security permissions to view it

5 minute read time.

A Customer was becoming frustrated that after importing company data from another system their users could not see the records.  They were getting the error message "The record you requested has been deleted or you may not have security permissions to view it".

They did know how to start to investigate the issue so I thought it was worth sharing some thoughts.

Check the logs
1st - the error "The recorded you requested has been deleted or you may not have security permission to view it" may have created an entry in the SQL logs.  That may give more details about the problem.  
In Sage CRM 2024 R2, the SQL logs are recorded in the SQL log file located at %ProgramFiles(x86)%\Sage\CRM\<CRM Instance Name>\Logs\ewaresql.log. A new file is created daily and can be used for diagnosing problems.
You can view logs from the user interface by following these steps:
  1. Click on | Administration | System | Logging .
  2. Click Change .
  3. Complete the Logging fields and click Save .
To view specific log files:
  1. From Select log files , choose the type of log files you want to view.
  2. In the View Log column, click the icon to open the log file.
Note:  Make sure that SQL Logging is turned on.  Don't be disappointed if nothing seems to show in the logs because strictly speaking this message isn't an error if the user can't view the record because of security rules (see below)  
Having said that, to ensure that all SQL transactions are recorded in the logs, you need to configure the SQL logging settings. To adjust the logging level and ensure all transactions are captured, you can follow these steps:
  1. Navigate to the SQL logging configuration settings in the Administration area.
  2. Set the logging level to capture all SQL transactions. "All queries over the threshold"
Increasing the logging level to capture all transactions may result in larger log files and could impact system performance. It is advisable to use detailed logging primarily for troubleshooting purposes.
Check Security Rights
2nd - The most likely scenario for this error is that the user doesn't have complete rights over the entity trying to be accessed.  

In Sage CRM, a screen like the Company Summary Screen relies on a view that aggregates data from multiple database tables. A view in Sage CRM is a virtual table that pulls data from one or more existing database tables and presents it in an alternative way. It does not store data but is used to return records in response to user searches and to display relationships between different entities.
For the Company Summary Screen, the view would typically include data from tables related to the company entity, such as contact information, phone, email and addresses. This allows the summary screen to present a comprehensive overview of the company by displaying relevant information from various related tables in a single, cohesive view.
The view is defined in the system and can be customized to include the necessary fields and relationships to support the data displayed on the summary screen.
Every user is Sage CRM will be assigned a security profile.  This is a way of grouping users to define their access rights within the system. It determines what actions users can perform on different types of records, such as viewing, updating, inserting, or deleting records.  For example, you can create a security profile called "Sales" with rights to view, update, and insert company, person, communication, and opportunity records, but with view-only rights to cases. This profile can then be assigned to all sales users, ensuring they have the appropriate access to perform their roles. Any changes made to the security profile automatically apply to all users assigned to it, allowing for efficient management of user permissions.
Coming back to our problem - "The recorded you requested has been deleted or you may not have security permission to view it" the view underlying the Company Summary Screen will bring together Company and Person records.  To view a company record and its associated default person record, a user must have the appropriate security rights set in their security profile. Specifically, the user needs:
  1. View Rights : The user must have view rights for the Company entity to see the company record.
  2. View Rights for Person : To see the default person record associated with the company, the user must also have view rights for the Person entity.
These rights can be configured by the system administrator in the user's security profile settings. Additionally, territory access rights may also apply, so the user must have the necessary permissions for the territory in which the company and person records reside.

Consider below

In my example I have set the Sales Rep security profile to have View, Insert and Edit rights for Person records in the users home territory but I have not given them rights if the record is assigned to them or even if they originally created the record.  This creates a "hole" whereby a user could have rights over the company - because it is in their territory but the default contact for the company is in another territory that the user does not have rights.  This would create the problem shown in the image at the top of this article.

This was a very long winded ways to basically say - check the security profiles to make sure that the users have rights over the company record AND the associate person records.

To sum up:  To ensure that Company and associated Person records imported and assigned to a user can be viewed by that user, you should consider the following steps:

  1. Security Profile Configuration : Ensure that the user's security profile grants them the necessary view rights for the Company and Person entities. This includes setting the appropriate permissions for viewing records within their assigned territory or team.
  2. Assigned To Rights : Verify that the user has "Assigned To" rights, which allow them to view and manage records specifically assigned to them, regardless of other security settings.
  3. Team Membership : If the records are associated with a team, ensure that the user is a member of that team and has the necessary team rights to view the records.

By configuring these settings, you can ensure that the assigned user has access to view the imported Company and Person records.

 I hope this helps!