Announcements
I want to prevent the deletion of Work order Products in the Work order screen in Dynamics 365 based on the field (Line status) value, if the "Line Status" value meets the criteria then the system should allow deleting otherwise a message box should be displayed. please help me to do it via Javascript. thanks a lot
Hi Irfan,
You can throw your alert using a web resource and calling it in the button click with the condition check.
Please follow the below steps:
Test the button
If this answer helps you, like and verify my answer
If you don't mind, do you have some code samples?
Hi Irfan K,
Do not you think workflow or plugins are easy ways to solve this problem instead of the JavaScript.
I think there are two easy way to do this:
- Via workflow
- Adding a custom display rule or custom command to the button in ribbon workbench
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 56 Super User 2026 Season 1
Eugen Podkorytov 49
Jimmy Passeti 31 Most Valuable Professional