Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Workflow contains an invalid custom activity.

(0) ShareShare
ReportReport
Posted on by

Hi,

Below is my plain custom activity code.

using

System;

using

System.Collections.Generic;

using

System.Linq;

using

System.Text;

using

System.Activities;

using

System.Threading.Tasks;

using

Microsoft.Xrm.Sdk;

using

Microsoft.Xrm.Sdk.Workflow;

namespace

ActivityLibrary1

{

public class Audit :

CodeActivity

{

protected override void Execute(CodeActivityContext

context)

{

//Create the IWorkflowContext and the

//IOrganizationService for communication with CRM

IWorkflowContext

workflowContext =

context.GetExtension<

IWorkflowContext

>();

IOrganizationServiceFactory

serviceFactory =

context.GetExtension<

IOrganizationServiceFactory

>();

IOrganizationService

service =

serviceFactory.CreateOrganizationService(workflowContext.UserId);

//Retrieve data from InputParameter

}

}

 

 

}

I am able to register the assembly and plugin uisng plugin registration tool, but when i am trying to add the custom activity to a process/workflow i m getting the below error.

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Workflow contains an invalid custom activity.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147200968</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message></Message>
  <Timestamp>2013-05-09T12:05:19.6794822Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>

Any help appreciated? Thank you.

 

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Workflow contains an invalid custom activity.

    Hi, We were able to fix the problem.

    We registred the assembbly in Sandbox mode, so while adding custom activity to the workflow it is giving error. Instead regsiter the assembly in 'None' mode. Please note that you should have 'Deployment Manager' access to register in 'None' mode.

    If you are using VS solution to register the assembly, you cant deploy a workflow in 'None' mode, instead use plugin registration tool.

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans