MS CRM 2011 - Developer Toolkit - Plugin is not firing for the second step added

Unanswered MS CRM 2011 - Developer Toolkit - Plugin is not firing for the second step added

  • 26. dubna 2012 23:47
     
     

    Hi,

    I am using developer toolkit for development of plugin. Registered plugin with first step and its working as expected. Then I had a requirement to add another step to the same plugin. I did it but then neither the plugin is firing not I am able to debug the plugin on second step (for first step, I can debug!). Probably, the reason being, the plugin constructor is holding information about the first step and there is no entry for the second step. Because of this, I am unable to debug the solution.

    Any solution for this problem?

    Thanks,
    Abhi

Všechny reakce

  • 27. dubna 2012 5:03
     
     

    Hello,

    Could you please share details about step, entity and other details about both plug-in steps.

    Are you registering the plugin for the sam step. Like pre account for both the plug-ins.

    If yes then you can use execution order say 1 for the first plug-in step and 2 for the second.


    Thanks, Ankit Shah


    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

  • 27. dubna 2012 10:33
     
      Obsahuje kód

    Hi Ankit,

    I am writing plugin for a custom entity for Create and Update messages.

    Please find below the steps details:
    First Step: Create of custom entity record, Pipeline stage - Post-Operation, Exe mode - Sync, Exe Ord 1, Deployment - Both, Post Image Alias - PostImage.

    Second Step: Update , Pipeline stage - Post-Operation, Exe mode - Sync, Exe order - 1, Deployment - Both, Pre and Post Images.

    And the interesting thing is, plugin is working fine for 'Create' step and not for 'Update' message.

    Also, the modified plugin constructor looks like below (just added the second line):

    public sampleplugin() : base(typeof(sampleplugin))
    {
    
    base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(40, "Create", "entitylogicalname", new Action<LocalPluginContext>(sampleplugine)))
    
    
    base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(40, "Update", "entitylogicalname", new Action<LocalPluginContext>(sampleplugine)))
    
    }

    But it didn't work for me. Any updates on this please?

    Thanks,
    Abhi

  • 27. dubna 2012 10:50
    Přispěvatel
     
     

    Hi abhidrocks,

    You will also need to add register the create step on the plugin to make sure that your plugin class is called by CRM on the Update step of the pipeline.

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

  • 27. dubna 2012 10:53
     
     

    If you disable the create step then is it working for update?

    I mean keep only update step and check whether everything is working as expected.


    Thanks, Ankit Shah


    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

  • 27. dubna 2012 11:12
     
     

    Hi Scott,

    Correct me if I am wrong. Is this what you mean to add to the plugin constructor (as i've already added this):

    base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(40, "Update", "entitylogicalname", new Action<LocalPluginContext>(sampleplugine)

    If not, please let me know what should i be doing.

  • 27. dubna 2012 12:27
    Přispěvatel
     
     

    Hi,

    That line of code is needed as well, but you also need to use:

    CRM Explorer->Plug-In Assemblies->(PlugIn) sampleplugin->Right Click->Add Step

    Then select the Update message and pipeline stage.

    This will tell CRM to call your code on Update - which then uses the RegisteredEvents to know which function delegates to call (specified by the Action<LocalPluginContext> delegate).

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

  • 27. dubna 2012 12:46
     
     

    Yes Scott. I've already added step through CRM explorer for update message. However, no success as yet.

  • 28. dubna 2012 21:22
    Přispěvatel
     
     

    That's strange then, are you sure that the plugin has been deployed. If you can, you might try creating a new plugin on the Update, and see if that works.

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

  • 3. května 2012 20:42
     
     

    Tried creating a new plugin on the update as well, but no success. Not sure why it's happening.

    So, as a last option, I followed the traditional way of developing plugins. At least, I can debug and step ahead now.

    Anyways, thanks a lot for all your support!

    Thanks,
    Abhi

  • 16. května 2012 9:22
     
     

    Try the Plugin Registration Steps as follows. This may help you,

    Register First step like this:

    and give the second step as follows:


    Naren