none
[CRM 2011] Get opportunity closure type from plugin

    Question

  • Hello Again,

    i'm creating a plugin that will fire on create of 'opportunityclose'

    but i need to know if this opportunity is getting canceled or closed as won

     

    i'm getting the target : Entity oppclose = (Entity)context.InputParameters["Target"]; 

    which is in our case opportunityclose

    the statecode and statuscode are the same if i'm canceling or closing the opportunity as won

     

    how can i get the opportunity statuscode ?

     

    thanks


    Elie
    • Edited by Elie Fadous Friday, September 30, 2011 2:25 PM
    Friday, September 30, 2011 2:24 PM

Answers

  • there is field name opportunityid in opportunityclose that you can use to retrieve the status of the opportunity

    or write your plugin on won and lost message of opportunity instead of opportunityclose

    I hope this helps. 


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    Friday, September 30, 2011 2:53 PM

All replies

  • there is field name opportunityid in opportunityclose that you can use to retrieve the status of the opportunity

    or write your plugin on won and lost message of opportunity instead of opportunityclose

    I hope this helps. 


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    Friday, September 30, 2011 2:53 PM
  • retrieving the status of the opportunity won't work because on create of the opportunityclose the opportunity is still open.

     

    but registering the plugin on the 'Win' and 'Loose' Messages will definitively do the job.

     

    Thanks for your help man,


    Elie
    • Edited by Elie Fadous Friday, September 30, 2011 3:10 PM
    Friday, September 30, 2011 3:09 PM