Book Image

Learning Force.com Application Development

By : Chamil Madusanka
Book Image

Learning Force.com Application Development

By: Chamil Madusanka

Overview of this book

Table of Contents (21 chapters)
Learning Force.com Application Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Preserving data quality with validation rules


Validations are common in any application. Suppose, the user has to enter a date value in a particular field. However, this date must be a future date. You have to validate the particular field. In the Force.com platform, the validation rules are there to fulfill your validation requirement.

The validation rules verify the user input data in a record against the criteria you define in the formula or the expression of the validation rule. A validation rule is associated with an object field. When a record is created or updated, the particular validation rules are executed. Define a validation rule by specifying an error condition and a corresponding error message. The error condition is written as a Boolean formula expression that returns true or false. When the formula expression returns true, the save will be aborted and the error message will be displayed. The user can correct the error and try again.

Note

The Force.com platform has some default...