RE: Phone Call - Dynamically change activity's status
Hi irenegr,
1.workflow.
You can create a workflow to change status when field value has changed with ‘completed’
You can go settings > System Job to see running details of the workflow.
Through test, I notice that the workflow only run when record create, though option field change, it can’t trigger the workflow.
So if you want to change status when option field change, add Js code to onChange event is a good way.
2.JS
(1) JS code.
function setState(executionContext) {
var formContext = executionContext.getFormContext();
var option = formContext.getAttribute("new_selectstatus").getValue();
if(option==true)
{
Xrm.Page.getAttribute("statecode").setValue(1);
}
}
(2) Add your JavaScript code in a Script web resource.
(3) Add an OnChange event with this Script web resource to the Phone call entity form.
(4) Test
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.