CRM 2011: Creating a plugin for a custom entity using CRM developer toolkit

Answered CRM 2011: Creating a plugin for a custom entity using CRM developer toolkit

  • Friday, April 13, 2012 11:11 PM
     
     

    Hi all,

    I was trying to create a plugin for a custom entity using crm developer toolkit, but I was facing some errors in the autogenerated code for the pugin.

    I have followed all the steps mentioned in the MSDN to create the plugin but I have failed. So I was wondering if there is any limitations in creating plugins using the developer toolkit for custom entities, if yes please let me know how to bypass it or guide me to the alternatives

    Thanks and best regards..

All Replies

  • Saturday, April 14, 2012 1:54 AM
     
     

    Hi,

      could you post the errors here?

      You can always create a plugin manually - here is a sample(just don't forget to reference crm assemblies in your project):

      http://msdn.microsoft.com/en-us/library/gg328263.aspx


      


    Alex Shlega, GotchaHunter.Net

  • Saturday, April 14, 2012 1:12 PM
     
     

    Alex,

    The list of errors are as follow:

    1 - The type or namespace name 'Plugin' could not be found (are you missing a using directive or an assembly reference?)

    2 - 'object' does not contain a constructor that takes 1 arguments

    3 - 'object' does not contain a definition for 'RegisteredEvents'

    4 - The type or namespace name 'LocalPluginContext' could not be found (are you missing a using directive or an assembly reference?)

    5 - The type or namespace name 'LocalPluginContext' could not be found (are you missing a using directive or an assembly reference?)

    6 - The type arguments for method 'System.Tuple<int,string,string,System.Action<LocalPluginContext>>.Tuple(int, string, string, System.Action<LocalPluginContext>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.

    7 - The type or namespace name 'LocalPluginContext' could not be found (are you missing a using directive or an assembly reference?)

    I haven't modified anything in the auto generated code and all the references are added by default

    Please advise

    Thanks and best regards..

  • Saturday, April 14, 2012 6:30 PM
     
     

    Hi Mostafa,

                    I just tested with the crm developer tollkit and don’t see any errors with the plugins on custom entities. For what I can see Plugin is a class defined on the Plugin.cs file that is generated by the project template. Be sure you have that file on your project, also, you can try creating a new project again. What project name or template did you use?

     


    Regards,
    Damian Sinay

  • Saturday, April 14, 2012 7:46 PM
     
     Answered

    Dear dsinay,

    Thanks alot for your help, it was all about that the Package name contains some spaces, once eliminated all goes well

    Sorry for disturbance :)

    • Proposed As Answer by nmathur Monday, April 16, 2012 8:47 AM
    • Marked As Answer by mo32 Tuesday, April 17, 2012 5:41 PM
    •