locked
Plug-in Post create CommunicationObjectFaultedException error in MS CRM 2015 RRS feed

  • Question

  • Hi All,

    I am having plug-in which is running on post event and it should create the related records.

    I am querying data using LINQ and it is failing at that stage with the below error.

    Query:

    var results =  from res in orgContext.CreateQuery<new_CustomEntity>()

                         where res.new_ParentCase.Id = _RecId

                         select res;

    int Count = Enumerable.Count(results);

    Error Details:

    System.ServiceModel.CommunicationObjectFaultedException: The Communication Object, System.Servicemodel.Channels.ServiceChannel, can not be used for communication because it is in faulted state.

    Please help me to resolve this issue.

    Thanks & Regards,

    Baji Rahaman

    Thursday, July 30, 2015 11:17 AM

All replies

  • Hello,

    Try following:

    var results =  from res in orgContext.CreateQuery("new_customentity")
                         where res.GetAttributeValue<EntityReference>("new_parentcase").Id == _RecId
                         select res;
    
    int Count = Enumerable.Count(results);
    BTW - could you additionally post code that you use to get _RecId?


    Dynamics CRM MVP
    My blog



    Thursday, July 30, 2015 11:39 AM
    Moderator
  • Thanks for responding Andrii.

    I found the issue and fixed.

    Actually Environment is On-Premise and I registered the plug-in on Sandbox mode. When I change mode to None issue is fixed.

    Thanks

    Baji Rahaman

    Thursday, July 30, 2015 5:23 PM