locked
Trigger Plugin on Chart Load/Refresh? RRS feed

  • Question

  • Hi Experts,

    I have a quick question.  Can we trigger a plugin on chart load or refresh? Which is the event/message the step to be registered against?

    Any help is greatly appreciated.

    Thanks,

    Palani

    Wednesday, June 21, 2017 6:18 PM

All replies

  • Hello Palani,

    The only message you can try is RetrieveMultiple of the main entity of chart.


    Dynamics CRM/Business Solutions MVP
    Read My blog

    Wednesday, June 21, 2017 9:29 PM
    Moderator
  • Hi Andrii,

    Thanks for your response.  I have a personal chart created on Account entity.  Are you referring to the RetrieveMultiple of Account entity in this case or the UserQueryVisualization entity here?

    My actual requirement is that I have a Retrieve and RetrieveMultiple intercept plugin registered on Account entity which controls the visibility of data in few Money fields.  That works in all the grid and on the form.  A user who does not meet the rules will have blank values in those fields, but if some user creates a chart using those fields, then the value is shown up on the Chart.  We were under the impression that even Charts and Reports would trigger the Retrieve and RetrieveMultiple plugins.  But it seems like that is not the case.  Can you please let me know any suggestions you have for achieving this functionality?

    Regards,

    Palani K.B.

    Thursday, June 22, 2017 12:14 PM
  • Hello,

    That means that RetreiveMultiple is not get triggered when chart is shown. I would suggest to consider usage of Secured field. I'm afraid that's the only way to resolve your issue.


    Dynamics CRM/Business Solutions MVP
    Read My blog

    Thursday, June 22, 2017 1:33 PM
    Moderator
  • Hi Andrii,

    Thanks again for your response.  Field security is not an option for us as we have to satisfy multiple business rules based on the user's security role/ownership of the record/access team membership and managerial hierarchy in order to show the values in certain revenue fields.  Please suggest if there is any other option that we can try.

    Regards,

    Palani K.B.

    Tuesday, June 27, 2017 12:51 PM
  • I'm afraid that you have no other options.

    Dynamics CRM/Business Solutions MVP
    Read My blog

    Tuesday, June 27, 2017 1:06 PM
    Moderator
  • For charts, you may be able to register a plugin on the Execute message - CRM used to use that message when using a Fetch query, which I think is what it will use for a chart. If so, you could potentially modify the fetchxml query and/or the results, but this would need xml manipulation, so it's a bit harder than a Retrieve or RetrieveMultiple.

    However, this won't work for reports, as no plugins are fired when CRM retrieves data for a report, even if it's Fetch-based


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Marked as answer by CRM_Intuition Wednesday, June 28, 2017 8:37 PM
    • Unmarked as answer by CRM_Intuition Tuesday, July 4, 2017 11:27 AM
    Tuesday, June 27, 2017 1:58 PM
    Moderator
  • @David That's cool. I expected CRM uses FetchQuery and not old fashioned Execute. As far as I remember this is how it worked in 4.0 times. That's weird that MS hasn't deprecated that part...

    Dynamics CRM/Business Solutions MVP
    Read My blog

    Tuesday, June 27, 2017 2:34 PM
    Moderator
  • Hi David,

    I tried to register a plugin on the Execute message.  During step registration, I was unable to select any Primary Entity against the Execute message.  I still registered the step and try to profile it while I loaded a chart and tried to refresh the chart.  The plugin did not seem to trigger.  So, I guess, the charts does not even trigger the Execute message.  Can you please let me know if you have any idea about this?

    Regards,

    Palani K.B.

    Tuesday, July 4, 2017 11:30 AM
  • Maybe the chart refresh doesn't trigger the Execute message, if the plugin is not called. Note that the Execute message does not have a Primary Entity, so if it did fire, it would be for all charts, and you'd need to determine the entity from the FetchXml

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Tuesday, July 4, 2017 1:34 PM
    Moderator
  • Hi Palani,

    Me too stuck with the same kind of requirement. Any way you got this to work?

    -Debajit

    Saturday, July 8, 2017 9:42 AM