Displaying error messages in CRM using COM API

By | October 4, 2010

Well, this is is just another way you can handle the error messages in CRM custom ASP pages. For one of the customizations i was supposed to write a validation for a field on screen being used in custom ASP pages. I did the same by writing below validate script.

If ()
    ErrorStr = “
    Valid = false;

After this i used Block.Validate() in custom page to check if blog is validated, but whenever a validation was fired, the error was displayed as given below. The error message was appearing both on panel as well as on top. Though this is not a great thing, this was one of the major designing issues reported by our client.

Well, after tickling my mind a bit on this, i thought if i have a custom ASP page, why am i suppose to write validate script? So i wrote the validation script on server side when mode of the page is changed to Save. Now what about the message i.e. a standard red bar error on top? Well, below is the HTML content that you can use to display error content using content block in your pages. How simple!

If you find this content useful, please feel free to drop us an email at crm@greytrix.com.