Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Log standard searches

Posted on by Microsoft Employee

Hello, I'm pretty new to CRM.

I would like to log standard/advanced searches in CRM on all entities. Does anyone know if there is any way to do this? Is there any way to catch the search parameters and the user when a search is done?

Thank you

*This post is locked for comments

  • Aiden Kaskela Profile Picture
    Aiden Kaskela 19,692 on at
    RE: Log standard searches

    Hi Oscar, I'm happy to help. Would you mind marking my answer as the verified one? Thanks a million, Aiden

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Log standard searches

    Hello aiden,

    Thanks for your advise! I was discussing it with some members of my team and we're simply gonna have to try it and see how it works performance wise.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Log standard searches

    Hi Sean,

    The function is the request of a customer. I'm not entirely sure what the goal is because they haven't stated it clearly. I believe it is for auditing.

  • Sean Michel Profile Picture
    Sean Michel 340 on at
    RE: Log standard searches

    Hi Oscar,

    I'd like to ask what your goal is? Do you need to capture all searches for auditing purposes? Or was there some other reason?

    Also, are you online or on-prem?

    Thanks!

  • Verified answer
    Aiden Kaskela Profile Picture
    Aiden Kaskela 19,692 on at
    RE: Log standard searches

    To write the plugin, you want to:

    - Create a new plugin registered on the RetrieveMultiple event, with "none" as the entity. It will run for views, advance finds or even SDK requests for every entity in CRM.

    - In the plugin code, make sure the MessageName is RetrieveMultiple, and that the InputParameters contains Query (that will be the query coming that was run)

    - The Query property will be either a FetchExpression or QueryExpression depending on where the query was initiated from.

    - When you have your expression, log it with your logger.

  • Suggested answer
    Aiden Kaskela Profile Picture
    Aiden Kaskela 19,692 on at
    RE: Log standard searches

    Hi! There sure is a way to do this, but you want to be careful because you could affect performance since searches happen all over the place. You can log the search request by creating a plugin on the RetrieveMultiple message, and every time a search is made it will call your plugin and give the what the search criteria was.

    Hope this helps! If so, I would greatly appreciate if you would mark this as the verified answer.

    Thanks!

     Aiden

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans