Created a common function to use for showing error of required fields.

GCP-9002

Reviewer: Darla (Post-Commit)