As part of our continuing GDPR improvement, I've been tasked to easily find all records which reference an email address, telephone number or name, entered by a user as a text string. Then we want to programmatically replace the personal data with random text.
Our org is elderly and rather bloated, and there are potentially references to a customer's email address in dozens of objects, going back to the beginning of the org.
I've not really had a use for SOSL before, but I think it might be the solution. However, I'm wondering if there's a way to perform a SOSL query and be able to return WHICH fields it found the text string in? This will future-proof the solution, in case some future dev or admin comes along and decides to create a new object which hard codes personal info rather than referencing a contact record.
So my question: is there a way, either in Apex or in the SOSL search itself, to return the fields that the search found the text in?
I know how to return specific fields in the search, but if I don't know in advance which field the search term might come up in, returning specified fields is no good to me.
Thanks in advance!