I want to keep track on what a customer searches in my portal. Does Salesforce have a standard object able to implement this requirement?

  • Are you using a custom search bar that runs SOSL, or the standard search bar? – IllusiveBrian Nov 16 '17 at 16:30
  • Hi thanks for the reply, basicly the user inserts some text and this text is then used in a sosl search – João Gomes Nov 16 '17 at 16:34
  • Do you want to keep tabs for all time or just for a specific date range? – Dan Kowalski Nov 16 '17 at 17:44
  • I want to keep tabs for all time – João Gomes Nov 16 '17 at 17:46
  • If feel you can use Event monitoring provided by Salesforce and that's accessiable via api only I guess but that capture every detail of a user for 30 days. This a paid feature and to enable this you need to reach your accounts team. – Praveen Biyani Nov 22 '17 at 3:47

The only standard feature I can think of that might solve this is a debug log that captures the debug logs from the class. You would have to set up a debug log in a date time range and it would only stay round for 7 days. You can read up more and debug logs at this link: https://help.salesforce.com/articleView?id=code_monitoring_debug_logs.htm&type=5

However this would capture a lot of activity and not just what search text was used. For something like that I would suggest creating a custom object that captures that information every time a search string is entered and used in the SOSL search. You would need to update your code so that a new record is created every time a search string is entered.

I would advise against something like that or dumping this into an external database and periodically purging the records from your system. I would suggest this because you will quickly run out of space in your org if you are constantly creating records every time a user does a search.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.