plugin development suggestion RRS feed

  • Question

  • Hello friends,
    Someone please suggest me how to proceed. I've tried in different ways with no luck.

    I have a requirement to cancel a child case's activities when two cases are merged using 'Merge cases' button in CRM 2013.
    Also, I have to change a lookup field's value along with canceling activities.
    So far I've written a plugin to cancel activities by registering on 'Merge' message. It's working successfully.
    Now I am trying to update lookup field value on same Merge message with
    another plugin. But nothing is happening. I tried to debug with
    profiler but not able to download the error log file. Used plugin registration tool to register.
    This is what I've been doing but I would like to know how would you proceed with this kind of requirement.
    Tuesday, November 18, 2014 9:35 PM

All replies

  • Did you try to write update call in same plugin to update required field ?

    Microsoft Dynamics CRM Training|Our Blog | Follow US | Our Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Wednesday, November 19, 2014 4:45 AM
  • Hi,

    I tried but I couldn't because for canceling the statecode as it is a read only attribute I've set its state using SetStateRequest.
    The ExecuteMultipleRequest fired but nothing happened. Is it possible to use SetStateRequest ands UpdateRequest in the same plugin.
    foreach (var item in ec.Entities)
                                    item.Attributes["subordinatedId"] = new EntityReference("task", subordinateId);
                                    item.Attributes["new_issuephase"] = entityTaskIP;
                                    //UpdateRequest updateRequest = new UpdateRequest { Target = item };

    I commented out UpdateRequest because it didn't work. So I wrote another plugin and used service.Update to update lookup field and registered it on Merge message.

    Wednesday, November 19, 2014 1:10 PM
  • Rather than using an UpdateRequest, can you register the plugin on the Pre event (stage = 20) of the Update message, and change the value in the Target InputParameter

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

    Wednesday, November 19, 2014 7:38 PM
  • David,

    But I don't have any updates in the entity that can trigger the plugin except the record state changes to 'Canceled'.


    Thursday, November 20, 2014 9:41 PM