To comply with "right to be forgotten" laws, customers can query and delete research results from the Account Research results (AiResearchPromptResult) using the API.
Use Salesforce Object Search Language (SOSL) and Apex queries to find and delete Account Research results containing PII.
STEP 1: Use a SOSL query to preview Account Research results containing PII.
Developer ConsoleQuery EditorExecute.
FIND {specific_keyword} IN ALL FIELDS RETURNING AiResearchPromptResult(Id, ReferenceRecordId, LatestResult)STEP 2: Use an Apex query to find and delete Account Research results
Developer ConsoleDebug > Open Execute Anonymous WindowExecute.
// Define the keyword you are searching for (a string)
String keyword = 'specific_keyword'; // Replace with your desired keyword
// Build the search term with wildcards for partial matching
String searchTerm = '*' + keyword + '*';
// Execute an inline SOSL query using the bind variable for the search term
List<List<SObject>> searchResults = [
FIND :searchTerm IN ALL FIELDS RETURNING AiResearchPromptResult(Id)
];
// Extract the AiResearchPromptResult records from the SOSL results
List<AiResearchPromptResult> resultsToDelete = (List<AiResearchPromptResult>) searchResults[0];
// Check if any records are found
if(!resultsToDelete.isEmpty()) {
// Delete the records
delete resultsToDelete;
System.debug(resultsToDelete.size() + ' records deleted.');
} else {
System.debug('No records found with the specified keyword.');
}
005232666

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.