locked
Error with plugin to change case state RRS feed

  • Question

  • Hi,


    I need to change the case state in post-create and post-update plugin depending on the value of a custom field. I am working with CRM 2016 online version

    I am using these messages depending on the target status:

      -SetStateRequest, for "Active".

      -CloseIncidentRequest, for "Resolved" or "Canceled".

    Post-update plugin works correctly with both messages, but with Post-create, this error is shown when using CloseIncidentRequest for "Resolved" or "Canceled" scenarios:

    Error: 500: Internal Server Error: There is no active transaction. This error is usually caused by custom plug-ins that ignore errors from service calls and continue procesing.

    After several tests, I have located a conflict with an "Activity Feeds". The particular error is with activity feeds "Close of case for contact". If this "activity feed" is disable, the plugin works properly.

    Any ideas about this? I would like to keep Activity Feeds working.

    Thanks in advance

    Wednesday, August 31, 2016 11:25 AM

All replies

  • I think the error message you get is not helpful; I expect that there's an error in the activity feed plugin (most likely that it cannot complete the operation once the case is closed)

    You could register the post-create plugin to run asynchronously; this should ensure the activity feed plugin completes first 


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

    Wednesday, August 31, 2016 12:57 PM
    Moderator
  • You have a try catch statement in the Plugin, and you havent thrown the error in the catch. Always note that CRM will not continue to run the plugin when the error occurs and even if try catch is available and error is ignored, Platform will give There is no active transaction error.

    If my response answered your question, please "mark the response as an answer" and also "vote as helpful". Regards, Hari. www.crm2011byhari.blogspot.com

    Friday, September 9, 2016 6:31 AM
  • Thanks, but I need the case to be synchronous. I have a grid on the form that needs to be refreshed to the case created.
    Monday, September 26, 2016 9:18 AM
  • The error occurs even though this encapsulated between a try and catch, and the case is not modified.
    Monday, September 26, 2016 9:21 AM
  • As I mentioned, Even if the methods are encapsulated between a try and catch, when the exception occurs system will rollback the transaction. this is a default platform behavior.

    You need to solve your error to proceed further as you cannot skip the error message in a Sync plugin


    If my response answered your question, please "mark the response as an answer" and also "vote as helpful". Regards, Hari. www.crm2011byhari.blogspot.com

    Monday, September 26, 2016 11:01 AM