locked
Disable plugin from dialog RRS feed

  • Question

  • Hello,

    my customer already has an CRM implementation that uses a (for me quite unusual) pre Retrieve plugin on the contact entity. In this retrieve plugin, the contact may or may not be updated automatically with the latest data and then shows the user the updated data in the contact form.

    For now, there is nothing I can do about the pre-retrieve plugin. The company needs this plugin. What I can do is update that plugin and make sure it will not trigger the data update based upon for example shared variables.

    Now, the issue is. I need to create a dialog that shows the contact information in a page, but I don't want this contact to be updated by the pre-retrieve plugin. How do I know within the plugin that the plugin is actually executed by a dialog? There is no way I can use the SharedVariables in the IWorkflowContext. Is there some other way to communicatie between the dialog and the plugins to solve this?

    Regards,

    Boudewijn

    Monday, January 5, 2015 9:51 AM

All replies

  • Hi,

    Check the below links.

    You can find the origin from where the plugin was triggered and disable (i.e stop the plugin) if you dont want it to run.

    https://social.microsoft.com/Forums/en-US/9d410268-f94a-4094-9541-920eb24cbebd/ms-crm-2011-how-to-identify-if-the-plugin-is-triggered-from-workflow-in-the-plugin-code?forum=crmdevelopment

    http://a33ik.blogspot.com/2012/06/callerorigin-in-plugins.html

    Hope this helps!!!

    Thanks,

    Prasad

    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Monday, January 5, 2015 10:18 AM
  • Thank you for your quick answer.

    I already retrieved the callerorigin, that returns ApplicationOrigin

    This was already impemented because this plugin should trigger when a user opens the form of the contact. Unfortunately the dialog also returns ApplicationOrigin

     

    Is there maybe an other way to detect the plugin is triggered by a dialog?

    Regards,

    Boudewijn 

    Monday, January 5, 2015 10:26 AM
  • I think the only possibility is to see if you can identify this through the ColumnSet InputParameter. I'm not sure what ColumnSet is passed when retrieving data via a dialog, but it may be possible to include a dummy attribute that is only included in the ColumnSet either when retrieving the data via a Crm form, or via the dialog.

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

    Monday, January 5, 2015 12:09 PM
    Moderator
  • Thanks I have tried.

    In this specific scenario the dialog shows contact information and automatically triggers the pre-retrieve plugin. Unfortunately there is no way to influence the columnset or input parameters. The contact information is shown on the first page in this dialog and then automatically triggers that (.....) plugin

    Monday, January 5, 2015 4:26 PM