Hi,
Is it possible to lock the control flip swith ?
Locking by field properties don't work.
Hi Olegof,
This option will just make the field can't be deleted from form.
To lock a field as what you expect, there are three methods:
1. Create a business rule for form,
set a specific field based on some condition,
e.g: if contact last name contains data, then block a custom field called "GDPR Consent":
save and active the rule:(I set rule scope to All forms, which means that the field will be locked for all forms.)
2. Add a cutom javascript function to form, execute it at form onLoad event.
formContext.getControl("new_gdprconsent").setDisabled(true); (parameter inside getControl function is logical name of field.)
Please read this article for how to use formContext:
https://carldesouza.com/using-formcontext-in-dynamics-365/
3. Instead checking "Field is read-only" option to always lock the field.
No matter which method you take, remember to save and publish form.
Flip switch will be gray out:
Regards,
Clofly