Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Dynamics CRM Custom Workflow Error

(0) ShareShare
ReportReport
Posted on by 85

Hi All,


There's an custom workflow fail with this exception
The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. 

when i update dll from plugin registration tool and make Isolation Mode from sandbox to None the problem solved 

but i want to register custom WF in Sandbox Isolation Mode .. So please any advice regarding this error ?

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: Dynamics CRM Custom Workflow Error

    Use service.retrieve request to fetch incident details instead of using organizationservicecontext.

  • David Jennaway Profile Picture
    14,065 on at
    RE: Dynamics CRM Custom Workflow Error

    I think the error is somewhere else in your code. The error indicates that there has already been a communication error. This will be a property related to the XrmServiceContext, so I expect the problem is either how you instantiate this in the calling code, or with some other use of this object

  • MohamedSaeed Profile Picture
    85 on at
    RE: Dynamics CRM Custom Workflow Error

    public static Incident GetCase(XrmServiceContext context, Guid IncidentID)

           {

               try

               {

                   var incidentQuery = from incident in context.IncidentSet

                                       where

                                           incident.Id == IncidentID

                                       select incident;

                   if (incidentQuery.ToList().FirstOrDefault() != null && incidentQuery.ToList().Count > 0)

                   {

                       return incidentQuery.ToList().FirstOrDefault();

                   }

                   return null;

               }

               catch (FaultException<OrganizationServiceFault> ex)

               {

                   throw new InvalidPluginExecutionException("Detail Message:" + ex.Detail.Message + "\nError Details:" + ex.Detail.ErrorDetails + "\nMethod Name:" + "GetCase");

               }

           }

    and error is :

    Sync workflow failed with error message - Unhandled Exception: Microsoft.Crm.Workflow.Services.InvalidCustomActivityExecutionException: Detail Message:Detail Message:System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.

    Server stack trace:

      at System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrImmutable()

      at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

    Exception rethrown at [0]:

      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

      at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

      at System.ServiceModel.ICommunicationObject.Open()

      at Microsoft.Crm.Sandbox.SandboxClientBase`1.Open()

      at Microsoft.Crm.Sandbox.SandboxClientBase`1.get_Proxy()

      at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #CFA0EB5D

    Error Details:Microsoft.Xrm.Sdk.ErrorDetailCollection

    Method Name:GetCase

    Activity Name:SendStudiesToCustomer

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Dynamics CRM Custom Workflow Error

    Hello,

    Can you please provide the source code of that workflow activity?

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 91

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 78 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans