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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans