web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
RichardM Profile Picture

RichardM 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans