locked
Get statuscode on opportunity WIN message, crm 2011 RRS feed

  • Question

  • Hi

    I need to create a plugin that will fire when an opportunity is closed as won (statecode = 1, statuscode = 3) that will check if certain fields are filled and prevent the action if they're not.

    I've registered the plugin on pre-operation of the WIN message and it generally works as it should, but my problem is that we have a bunch of statuscodes for statecode=1 (WIN) and I only care about one of those.

    I know I can retrieve the opportunity in question from the OpportunityClose entity I get, but since it's pre-operation the code will not be updated yet, I also cannot register a post-image to this message, so my question is: can I get the statuscode of my opportunity in this situation?

    Thursday, October 3, 2013 2:35 PM

Answers

  • I've not tested it, but I think there should be an InputParameter named Status that should have the selected statuscode for the opportunity


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

    • Marked as answer by Grzegorz Zych Tuesday, October 8, 2013 9:48 AM
    Thursday, October 3, 2013 5:37 PM
    Moderator
  • Hi,

    I have tested this before on post operation. In target you will get Status in input parameter but I didn't test this on pre operation.

    I think you will get the same in pre operation as well. Please give a try.

    Thanks!

    • Marked as answer by Grzegorz Zych Tuesday, October 8, 2013 9:48 AM
    Thursday, October 3, 2013 5:56 PM

All replies

  • I've not tested it, but I think there should be an InputParameter named Status that should have the selected statuscode for the opportunity


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

    • Marked as answer by Grzegorz Zych Tuesday, October 8, 2013 9:48 AM
    Thursday, October 3, 2013 5:37 PM
    Moderator
  • Hi,

    I have tested this before on post operation. In target you will get Status in input parameter but I didn't test this on pre operation.

    I think you will get the same in pre operation as well. Please give a try.

    Thanks!

    • Marked as answer by Grzegorz Zych Tuesday, October 8, 2013 9:48 AM
    Thursday, October 3, 2013 5:56 PM
  • Thank you for the answers.

    Indeed, the InputParameter "Status" contains the new status, even on pre-event.

    Tuesday, October 8, 2013 9:49 AM