Disable field on change of tab in D365 CE
Use case – Our requirement is to enable field description field on invoice line form on clicking of tab General.
Let’s see how we can achieve this
Solution –
Step 1 – Create web resource with below function-
var invoiceLineCustomization = { unlockField : function(executionContext) { var formContext = executionContext.getFormContext(); formContext.getControl("description").setDisabled(false); }, }
Step 2: Add this web resource on tab property event TabStateChange and try.
(path to go to event tab – Click on tab -> change properties -> event)
![](https://www.cloudfronts.com/wp-content/uploads/2021/05/image-19-1024x508.png)
Output –
![](https://www.cloudfronts.com/wp-content/uploads/2021/05/image-20-1024x349.png)
Hope this helps !