You must be already familiar with Locking fields on the form in Dynamics 356 CRM so that they are not removed from the form unless you remove the Lock.
Also, it’s a “best practice” to add Dependencies explicitly to your events so that if multiple customers are working on the same form, no one should delete a field which is required by Events added to fields/forms.
In the modern form designer, it looks like below
And when you try to remove the field from the form, you’ll see this error.
Now, there’s also another way you can lock this field and not remove it explicitly due to a dependency – Let’s see what we have in the modern app designer!!
Events dependency in modern app designer
Let’s say you are using the modern app designer to work on your forms, here’s what you notice
- For example, you are using the modern App Designer and you are working on Website field on the Account entity.
Let’s add an Event Handler for the Website field in the modern designer.
- Once you added an event, you’ll see a Column Dependency field which can choose to select fields. (Denoted by arrow in below screenshot)
- Here, I’ll select the Website field from the dropdown so that the Lock is established on the field.
- So now, when I look at the field Properties, the Lock will be disabled and I can’t choose to remove it explicitly from the Properties itself.
In Classic Form Editor
Here’s where you can add dependencies to Event Handlers in the Classic Form Editors (I’ll be honest, this usually goes unnoticed and I never cared to add dependency)
- Wherever you add Events on the field/form, look for the Dependencies tab on the window where you add the JS function.
- And you’ll see the fields which are selected for Dependencies so that they are not accidentally removed.
Here are some more Power Apps related posts you might want to check out –
- HTML Text control in Canvas Power Apps | Power Platform
- Configure Dataverse Search in Power Platform Admin Center | Dynamics 365
- Form Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365
- Log Canvas Power App telemetry data in Azure Application Insights | Power Apps
- Variables in Canvas Power Apps | Global and Context
- Dynamics 365 Solutions’ New Experience in Power Apps, Solution Checker and more
- Navigate Screen automatically based on Timer in Canvas Power App | Power Platform
- Advanced Lookup in Model-Driven Apps | Power Platform
- New App Designer for Model-Driven Apps | Power Platform
- Primary Key of Activity type entity in a Dataverse connector in Power Automate | Quick Tip