Operations in Business Process Flow using JavaScript in D365 CRM
Introduction – In this blog, you will learn about how we can perform different operations such as disable, enable, hide, etc. on D365 CRM Business Process flow using JavaScript.
Set value in Business Process Flow
var formContext = executionContext.getFormContext();
let bpfControl = formContext.getControl('header_process_cf_outreach')
let attribute = bpfControl.getAttribute();
if(attribute != undefined)
{
attribute.setValue(979570000);
}
Disable field on Business Process Flow
formContext.getControl("header_process_cf_outreach").setDisabled(true);
here cf_outreach is the schema name of the field on BPF. for BPF we need to write header_process before the schema name of the field
Enable field on Business Process Flow
formContext.getControl("header_process_cf_outreach").setDisabled(false);
Hide a field on Business Process Flow
formContext.getControl("header_process_cf_outreach").setVisible(false);
Mark Field Required on Business Process Flow
var formContext = executionContext.getFormContext();
let bpfControl = formContext.getControl('header_process_cf_outreach');
let attribute = bpfControl.getAttribute();
if(attribute != undefined)
{
attribute.setRequiredLevel("required");
}
Mark Field Optional on Business Process Flow
var formContext = executionContext.getFormContext();
let bpfControl = formContext.getControl('header_process_cf_outreach');
let attribute = bpfControl.getAttribute();
if(attribute != undefined)
{
attribute.setRequiredLevel("none");
}
Mark field recommended on Business Process Flow
var formContext = executionContext.getFormContext();
let bpfControl = formContext.getControl('header_process_cf_outreach');
let attribute = bpfControl.getAttribute();
if(attribute != undefined)
{
attribute.setRequiredLevel("recommended");
}
Related posts:

Every Target Traced to a Deal: Dynamics 365 Sales Visibility for an Australian Commercial Laundry Pr...

Why Is Consumption Quantity Showing Zero in Dynamics 365 Business Central? A Pharma Manufacturing Ca...

How We Built a Role-Based Customer Portal in Microsoft Power Pages for a US-Based IT Services Provid...

