locked
IPluginExecutionContext has always PostImages equals to null RRS feed

  • Question

  • Hi all,

    I've register plugin on email entity on Post Update and I've associated Post Image on MS CRM 2013, but IPluginExecutionContext.PostImages is always null and PrimaryEntityId is Guid.Empty.

    How can I solve these issues?

    Thanks.

    Thursday, February 13, 2014 3:36 PM

All replies

  • Hello,

    Could you share screenshots of your image registration and code that you are trying to access it.


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    • Marked as answer by a.cunsolo Friday, February 14, 2014 12:00 PM
    • Unmarked as answer by a.cunsolo Friday, February 14, 2014 12:00 PM
    Thursday, February 13, 2014 4:20 PM
    Moderator
  • Thanks for your reply.

    Code is follow:

    var context = (IPluginExecutionContext) serviceProvider.GetService(typeof(IPluginExecutionContext));

    if (context.PostEntityImages == null)

                    throw new InvalidPluginExecutionException("PostImages null");

    I've checked that the exception was thrown on "Plugin Profiling" by "Plugin Registration Tool", on standard execution of plugin nothing thrown.

    Friday, February 14, 2014 10:33 AM
  • Hello,

    Are you sure your plugin executing, how you are testing your plugin, could you share event registration details as well ??


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Friday, February 14, 2014 1:41 PM
    Moderator
  • yes I'm sure that plugin is executing, by standard process for debugging plugin create debug context after profiling.

    I'm sure that I've selected correct step.

    Below images with step registration:

    Friday, February 14, 2014 3:43 PM
  • How you are testing your plugin ?? Are you getting below exception while testing your plugin

      throw new InvalidPluginExecutionException("PostImages null");


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Saturday, February 15, 2014 3:18 PM
    Moderator
  • Do you registering your plugin steps correct ? refer this post

    http://3.bp.blogspot.com/-4qotzVmK37E/UJHAn8ookOI/AAAAAAAAA3Q/ytRcdeRH1As/s1600/C1_ImageDiff1Registration.jpg

    Hope this helps.


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Mohammad Yusuf Ansari http://microxrm.blogspot.in

    Sunday, February 16, 2014 11:08 AM
  • I get exception when testing plugin by attaching visual studio debugger to Plugin Registration tool as standard process like step on this link:

    http://inogic.com/blog/?p=61

    With standard execution of plugin I do not get any exception.

    Thanks for your help

    Monday, February 17, 2014 12:08 PM
  • Hi

    Are you sure, when debugging the plugin in Visual studio, the build dlls are similar to what you have deployed in assembly folder.

    If the builds are different in two places, that could cause the issue.

    Monday, February 17, 2014 12:12 PM
  • Thanks for you reply, but I'm sure that version on server and local version are the same.

    Plugin has been registered on "sandbox" could it be a problem?

    Monday, February 17, 2014 2:50 PM
  • DId u change any information on form, before you clicked save and triggered the plugin.

    try doing that.

    • Edited by CRMDevlpr Monday, February 17, 2014 3:37 PM
    Monday, February 17, 2014 3:37 PM
  • Yes, I do.

    Any suggestions?

    Monday, February 17, 2014 4:07 PM
  • Hi

    Please try another test plugin ,a small one and see if you are getting the postimage or not. If you are getting the postimage correctly then try un-registering and re-registering the plugin on the email update again and see if it works.


    If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful" Thank you, DT

    Tuesday, February 18, 2014 6:12 AM