Asked by:
Unable to register custom workflow activity on MS CRM 2015 Online

Question
-
Hi All,
I am trying to register custom workflow activity using plugin registration tool on MS CRM 2015 Online.
Error says that 'No Plugin have been selected from list. Please select atleast one and try again'
In short my assembly is not considered as custom workflow activity.
I am giving my code let me know, If any thing is wrong.
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 Training.SamplePlugin
{
public class SampleCustomworkflow : CodeActivity
{
[Input("Birthday")]
public InArgument<DateTime> BirthDate { get; set; }
[Output("NextBirthday")]
public OutArgument<DateTime> NextBirthDay { get; set; }
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);
if (context.PrimaryEntityName.ToLowerInvariant() == "contact")
{
DateTime birthDate = BirthDate.Get<DateTime>(executionContext);
DateTime nextBirthDate = new DateTime(DateTime.Now.AddYears(1).Year, birthDate.Month, birthDate.Day);
//NextBirthDay.Set(executionContext, nextBirthDate);
Entity newContact = new Entity();
newContact.LogicalName = "contact";
newContact.Id = context.PrimaryEntityId;
newContact["new_nextbirthday"] = nextBirthDate;
service.Update(newContact);
}
}
}
}
If code is correct then has somebody faced this kind of issue earlier, what is resolution.
Thanks
Apurv
Friday, February 20, 2015 9:38 AM
All replies
-
Have your signed your assembly ??
Microsoft Dynamics CRM Training|Our Blog | Follow US | Our 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 20, 2015 1:29 PMModerator -
You need to select the assembly before clicking register button. You will see a checkbox.
Regards Faisal
- Proposed as answer by Guido PreiteMVP Friday, February 20, 2015 3:58 PM
Friday, February 20, 2015 2:20 PM -
The other thing to check is the .Net version of the System.Activities assembly that you reference. For Crm Online it must be at least 4.0.3, and may need to be 4.5 for Crm 2015 Online
Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk
Friday, February 20, 2015 4:41 PMModerator -
I can't see any workflow in given assembly.
I am able register same .dll on on-premise version of mscrm 2015
Thank you.
Sunday, March 8, 2015 1:50 PM