Set Field Error Notification using JavaScript by checking related parent entity record info in Dataverse Model driven app power apps

Sometimes you need to show error against form fields if some field value of parent record not met the required value. You can use below script and modify for your project. Hope this helps.