Dynamics 365 – Make the Form Readonly with Javascript
To make the form read-only in Dynamics 365 you have 2 options. Either changing record status to Inactive or making all form fields disabled with Javascript.
Changing record status to Inactive might not suitable for some business cases. For example you might want to make your form read-only based on an attribute. If you change your status to inactive, it might trigger record cascading, which will cause to setting related child record status to also inactive. In addition your record won’t show up under Active records view.
If you think this is not the best way for you, then you can use Javascript. The below piece of code sets all form fields to read-only dynamically. It will loop through your form controls(tabs, sections, feilds) one by one and disable them.
No comments:
Post a Comment