Handling UI events
For the instances where you need to block the form from getting saved due to a user input error I have mentioned briefly, it's always a good idea to return a message to the user and notify them of the reason for such a decision. The option specified results in returning an alert message to the user.
In other situations, you will find that posting a message on the form itself can be much more efficient. For one, it does not require an additional click of the mouse. Also, you can create a tally of all the messages, and display them all in one single spot, formatted to stand out.
Note
This recipe describes a customization approach that is not officially supported. The reason for this is that referencing the form elements is done outside ...
Get Microsoft Dynamics CRM 2011 Scripting Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.