How to get Process Finish Button event in Dynamics CRM?

跟風遠走 提交于 2021-02-19 02:25:08

问题


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.

I have done some research and found that (OnProcessStatusChange event) can help to get business process flow status change (statuses: Active, Finished, or Aborted)

Ref Link: OnProcessStatusChangeEvent

I have checked this by adding this to form OnLoad event like below, but nothing happens.

Xrm.Page.data.process.addOnProcessStatusChange(setProbablityOnFinish);

Is there any other solution?


回答1:


Make sure you implement the eventhandler like this, it will work.

function OnLoad() {
   Xrm.Page.data.process.addOnProcessStatusChange(statusOnChange);
}

function statusOnChange() {
   status = Xrm.Page.data.process.getStatus();
   if (status == "finished") {
       //Write your logic here//
   }
}


来源:https://stackoverflow.com/questions/47950490/how-to-get-process-finish-button-event-in-dynamics-crm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!