locked
Registering custom workflow activity RRS feed

  • Question

  • Hi,

    I wrote my custom activity eg. it's looks like:

    namespace ShareActivity2
    {
        [CrmWorkflowActivity("Share with other")]
        public class CustomShare : Activity
        {
            public static DependencyProperty ownerrProperty = DependencyProperty.Register("ownerr", typeof(Lookup), typeof(CustomShare));
    
            [CrmInput("ownerr")]
            [CrmOutput("ownerr")]
            public string ownerr
            {
                get
                {
                    return (string)base.GetValue(ownerrProperty);
                }
                set
                {
                    base.SetValue(ownerrProperty, value);
                }
            }
    
            protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
            {
                IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));
                IWorkflowContext context = contextService.Context;
    
                CrmService crmService = (CrmService)context.CreateCrmService();
    
                return base.Execute(executionContext);
            }
        }
    }
    I signed dll and now i'm registering it by PluginRegistration.exe. I search organizations, get connection and click "Assembly Registration". Search my dll in C:\Program Files\Microsoft Dynamics CRM Server\Server\bin\assembly and choose register. Everything it's ok. I restart IIS and async service in services. But when i go to workflows and search for my new activity it doesn't show there..... Help ;)! What I'm doing wrong?

     


    ...
    Monday, April 12, 2010 8:58 AM

Answers

  • I guess Tanguy is right, try derive the from SequenceActivity class..

    Other things that i noticed is that you got same property (ownerr) marked as input and output, which might also not valid..

    [CrmInput("ownerr")]
     [CrmOutput("ownerr")]

    Please check following article for example on how to develop custom workflow activty..try comparing your development step with this article and hopefully you will able to resolve the problem..

    http://www.stunnware.com/crm2/topic.aspx?id=CustomWorkflowActivity

     

    • Marked as answer by T72 Monday, April 12, 2010 10:20 AM
    Monday, April 12, 2010 9:24 AM
    Answerer

All replies

  • For my part, I derive the class from SequenceActivity, not Activity but I don't know if this is really the source of your problem
    My blog : http://mscrmtools.blogspot.com
    You will find:
    Bulk Delete LauncherView Layout replicator
    ISV.Config Manager Form Javascript Manager
    Assembly RecoveryAnd others (use tool tag on my blog)
    Monday, April 12, 2010 9:04 AM
    Moderator
  • Just have a breeze through this article and make sure you've covered everything http://msdn.microsoft.com/en-us/library/ee704600.aspx
    MSCRM Bing'd - http://bingsoft.wordpress.com
    Monday, April 12, 2010 9:22 AM
    Moderator
  • I guess Tanguy is right, try derive the from SequenceActivity class..

    Other things that i noticed is that you got same property (ownerr) marked as input and output, which might also not valid..

    [CrmInput("ownerr")]
     [CrmOutput("ownerr")]

    Please check following article for example on how to develop custom workflow activty..try comparing your development step with this article and hopefully you will able to resolve the problem..

    http://www.stunnware.com/crm2/topic.aspx?id=CustomWorkflowActivity

     

    • Marked as answer by T72 Monday, April 12, 2010 10:20 AM
    Monday, April 12, 2010 9:24 AM
    Answerer
  • I changed to SequenceActivity but it doesn't help.

     

    I did everything from http://msdn.microsoft.com/en-us/library/ee704600.aspx but... in section Registering the Custom Workflow Activity they describe eg.

    7. in the tab for your organization, select Register and then select Register New Assembly. The Register New Plugin window opens.

    In PluginRegistration.exe from CRM 4.0 SDK I dont have any tab's. I dont have this buttons. Maybe I have different tool? Older or something?


    ...
    Monday, April 12, 2010 9:26 AM
  • It is just referring to the list of orgs in the left hand nav pane of the registration tool. IT just ensures you add the plugin to the correct org.

     

     


    MSCRM Bing'd - http://bingsoft.wordpress.com
    Monday, April 12, 2010 9:55 AM
    Moderator
  • Bingo! I try to do this by Developer registration tool but it didn't work. In line:

    connection.service.Create(plugintype);

    I had error:

    Server was unable to process request.

    In data:

    "\n 0x8004501d\n The parameter name 'ownerr' of property ownerr already exist, the names must be unique\n Platform\n"

     

    So... i change from  [CrmInput("ownerr")] to [CrmInput("Ownerr")] :]

    Thank's all for help. I select as answer  MayankP's post because in his link is a sample of use developer tool.


    ...
    Monday, April 12, 2010 10:20 AM
  • Ummmmmmmmmmmmmm i have another problem :/. Now when I try to publish my workflow with this activity I receive error...

    In event viewer I have something about error on invocation target.

     

    Ups ;) i had typeof(Lookup) and public string ownerr ;) so nevermind...


    Monday, April 12, 2010 10:32 AM