Best practice CRM 2011 interaction workflow , plugin RRS feed

  • Question

  • An external company has developed our stuff and not all is working correct.

    It starts with a workflow which update a record field from false to true. This is not visible in CRM yet.

    This triggers a plugin, which lopes through records of an other entity and it registrates the number of faults and update the target entity with this info. After this update the field is in CRM true.

    The workflow gives an error:

    [Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.UpdateEntity]

    Error Message:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Need to start a transaction before commitDetail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>Need to start a transaction before commit</Message>
        <ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
        <Message>Need to start a transaction before commit</Message>

    The plugin is pre-operation. When I change it to post and asynchronous, then the record is updated , but the total faults is not updated in the record.

    What is going wrong an how can I fix it correct.

    Wednesday, October 28, 2015 11:34 AM

All replies

  • I think you're going to have to get hold of the plugin code and debug it. The error 'Need to start a transaction before commit' normally indicates that something has previously failed within the plugin (or data changes caused by the plugin). You might get more information by enabling tracing, but I think you'll need to code to do anything about it.

    In most cases, plugin code is written specifically for a particular stage (pre or post), and often will not work if you change the stage in the registration step


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Wednesday, October 28, 2015 4:32 PM