Empty Rich Text Fields Validation using Regular Expression in Dynamics 365


The article discusses an issue with the Description field in Dynamics 365 CRM, where HTML tags are retained even when the field appears empty. This can lead to inaccurate validation and retrieval of records. To address this, the article suggests using regular expressions in C# to accurately determine if the Description field is truly empty. The provided code demonstrates how to implement this validation logic. By checking for HTML tags with non-whitespace content, the code can handle cases where HTML tags with text are present and throw an error for empty fields. This approach ensures robust validation and reliable business logic implementation in Dynamics 365 applications.


Article 11m

Login now to access my digest by 365.Training

Learn how my digest works
Features
  • Articles, blogs, podcasts, training, and videos
  • Quick read TL;DRs for each item
  • Advanced filtering to prioritize what you care about
  • Quick views to isolate what you are looking for right now
  • Save your favorite items
  • Share your favorites
  • Snooze items you want to revisit when you have more time