title: How to get Process Finish Button event in Dynamics CRM?
body: <p>I am using Dynamics 365 online instance to integrate sales process. I have one condition where I need to change the Probability field value to 100 when user clicks on Finish button in Close Process Stage.</p>
  
  <p><a href="https://i.stack.imgur.com/1EFQL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1EFQL.png" alt="enter image description here"></a></p>
  
  <p>I have done some research and found that (<strong>OnProcessStatusChange event</strong>) can help to get business process flow status change (statuses: Active, <strong>Finished</strong>, or Aborted)</p>
  
  <p>Ref Link: <a href="https://msdn.microsoft.com/en-us/library/dn817874.aspx" rel="nofollow noreferrer">OnProcessStatusChangeEvent</a></p>
  
  <p>I have checked this by adding this to form OnLoad event like below, but nothing happens.</p>
  
  <pre><code>Xrm.Page.data.process.addOnProcessStatusChange(setProbablityOnFinish);
  </code></pre>
  
  <p>Is there any other solution?</p>