Skip to main content

Notifications

Customer Service forum

Dynamics CRM Customer service hub app does not fire plugins

Posted on by Microsoft Employee

I have written plugin on savedquery to restrict system views, it works on dynamics crm main app but does not work on customer service hub app.

Plugin does not fire on customer servvice hub app.

Please suggest. 

Categories:
  • billiardguy Profile Picture
    billiardguy 70 on at
    RE: Dynamics CRM Customer service hub app does not fire plugins

    I am running into the same issue.  I have a plugin that I want to use to modify a specific filter in from a view. I am using version 9+ online.  In the custom system (web based), the plugin gets fires on the RetrieveMultiple message for each of my views, but in the Sales Hub the plugin will not fire for the view with the filter I want to change.

    Any updates on this.  Thanks!

  • Suggested answer
    keyur7379 Profile Picture
    keyur7379 900 on at
    RE: Dynamics CRM Customer service hub app does not fire plugins

    Hi Rohit,

    I am facing same issue. It is not working in unified service hub app. I just created support ticket in Microsoft. I will let you know once I get answer.

    Thanks,

    Keyur shah.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics CRM Customer service hub app does not fire plugins

    Hi,

    Thanks for the response :)

    Same thing I was thinking that plugins should not be effected by the main app or unified Interface, but my plugin is not being triggering in the customer service hub but working fine in main app.

    The main objective of plugin is to show/hide system views as per user role.

    eg: Users having role X  can see only system views A,B,C  and Users having role Y can see only system views D,E,F.

    So solve it I wrote below plugin:

    var organizationServiceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
    var pluginContext = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
    var orgService = organizationServiceFactory.CreateOrganizationService(pluginContext.UserId);

    if (pluginContext.PrimaryEntityName.Equals("savedquery") && pluginContext.InputParameters.ContainsKey("Query") && pluginContext.InputParameters["Query"] is QueryExpression)
    {

          var userRole = "dev";

          var views= new List<string>() {"A","B","c" };

          if(userRole == "dev"){

    var hideViewCondition = new ConditionExpression("name", ConditionOperator.NotIn, views.ToList().Distinct().ToArray());
    query.Criteria.AddCondition(hideViewCondition);

         }

    }

     

    Find Below Step registered with plugin:

     

    img.png

     

    Please suggest.

      

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Dynamics CRM Customer service hub app does not fire plugins

    Hi partner,

    Plugins are not affected by using main app or unified Interface(like Customer Service hub) because plugins are used to do some data interaction in the background, for example, we added a plugin when saving account, whether you are using main app or unified interface, the plug-in will be trigged.

    Could you share more information about your plug-in? What is the main entity and how did you set it? By the way, could you kindly explain what exactly does "savedquery" mean?

    Best Regards,

    Leo

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,902 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,297 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans