Custom Workflow Activity not showing in Plugin Registration
M

2

7

Could anybody suggest what I am doing wrong here?

I have created a Custom Workflow Activity using this sample Create a custom workflow activity. But this is not showing up as a plugin/activity type in Plugin Registration Tool. See image below:

enter image description here

My sample code for the activity below:

CODE UPDATED

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;

namespace TestCustomWorkflowActivity
{
    public class SampleCustomActivity : CodeActivity
    {
        protected override void Execute(CodeActivityContext executionContext)
        {
            //Create the tracing service
            ITracingService tracingService = executionContext.GetExtension<ITracingService>();

            //Create the context
            IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
            IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
            IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);

        }
    }
}

Platform
Dynamics CRM 2013 On Premises v 6.1.2.112 (SP1 UR2 installed)
Dynamics CRM 2015 Online

.NET Framework version
4.0

Mccants answered 16/4, 2015 at 9:40 Comment(0)
A
8

Is it a case that your holding class needs to be be public?

class TestWfActivity

Should be

public class TestWfActivity

Or that the Activity class should reside directly from your namepspace rather than insdie the TestWFActivity class.

Try either -

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;

namespace TestCustomWorkflowActivity
{
    public class TestWfActivity
    {
        public class SampleCustomActivity : CodeActivity 
        {
            protected override void Execute(CodeActivityContext executionContext)
            {
                //Create the tracing service
                ITracingService tracingService = executionContext.GetExtension<ITracingService>();

                //Create the context
                IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
                IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
                IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);

            }
        }
    }
}

or

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;

namespace TestCustomWorkflowActivity
{

        public class SampleCustomActivity : CodeActivity 
        {
            protected override void Execute(CodeActivityContext executionContext)
            {
                //Create the tracing service
                ITracingService tracingService = executionContext.GetExtension<ITracingService>();

                //Create the context
                IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
                IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
                IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);

            }
        }
}
Arabian answered 16/4, 2015 at 9:43 Comment(5)
I thought this would be the cause as apparently it should be public. But even after updating this in the code it is not showing the class in the Plugin Registration Tool. See the updated code in my post above,Mccants
And you have completed step 13."In the project properties, under the Signing tab, select Sign the assembly and provide a key file name. Custom workflow activity (and plug-in) assemblies must be signed."Arabian
Hey DotNetHitMan, I am sorry it seems this was an access modifier issue for CRM Online but the class is still not appearing on CRM 2013 On Premises. Is there any setting on the On Premises server that controls this?Mccants
Hi @Ali.NET, I am more of a Workflow / Workflow Activities guy so I am sorry I cannot really answer on the CRM side :( maybe close this question and ask another one?Arabian
Well apart from my silliness two more things needed to be configured to deploy custom workflow assemblies into Dynamics CRM: 1) User account should have deployment administrator privileges. 2) Declarative workflows shuould be enabled on the Microsoft Dynamics CRM server. NOTE: The newer Plugin Registration Tool version 6.1.1.1143 doesn't recognize custom workflow assemblies. User older version of the tool for this purpose,Mccants
M
7

I had the exact same issue while working with CRM 2013 (both on-premise and online). I never managed to actually solve the issue, but easily worked around it by using the Registration Tool from 2015's SDK instead. For unknown reasons that one works better.

Marianamariand answered 1/9, 2015 at 11:7 Comment(1)
I confirm having same issue on Plugin Registration Tool from SDK for CRM 2013. After downloading SDK for CRM 2015 I was able to update workflow activity.Schmooze

© 2022 - 2024 — McMap. All rights reserved.