How to Lock Business Process field | Dynamics CRM 365

How to Lock Business process field lock | Dynamics CRM BPF field lock using javascript


In this blog, you will learn how to lock business process field dynamics CRM 365.


When working with Microsoft Dynamics 365 CRM, there are situations where certain fields in a Business Process Flow (BPF) should be visible to users but should not be editable.

For example, fields such as Outcome, Opinion Status, and Recommended Settlement may need to be controlled to prevent users from accidentally changing values that have already been reviewed or finalized.

In this article, I have explained how to use JavaScript to make specific BPF fields read-only by disabling their controls.

The approach is simple and can be useful for maintaining data consistency, business process control, and data integrity across Dynamics 365.

💻 Example:

Here is the javascript sample code:

function bfffieldlock(executionContext) {
     var formContext = executionContext.getFormContext();
    formContext.getControl("header_process_vwi_outcome").setDisabled(true);
    formContext.getControl("header_process_vwi_opinionstatus").setDisabled(true);
    formContext.getControl("header_process_vwi_recommendedsettlement1la").setDisabled(true);
    formContext.getControl("header_process_vwi_opinionstatus").setDisabled(true);
}

#BusinessProcessFlow #Dataverse #Microsoft

Next Post Previous Post
No Comment
Add Comment
comment url