Field and List Item Validation in SharePoint 2010 Lists

SharePoint 2010 Lists support Field Validation which enables you to validate the values.  Field Validation allow you to “specify the formula that you want to use to validate the data in this column when new items are saved to this list. The formula must evaluate to TRUE for validation to pass. “

Example: If your column is called "Company Name" a valid formula would be [Company Name]="My Company".

To Test out the Validation go to the List and Select List from List Tools

Click Create Column
The Enter Title of the Column and select type the type.  for this example I have a column name Employee Age which should be a number greater than 25
Expand the validation section and Write your formula and message.  You should enter the try condition and message for wrong values.
Now Create or edit the existing item to test your formula
List item Validation Works same but we can write a formula to verify the item.  We can specify the formula you want to use to validate the data in this column when new items are saved to this list. To pass validation, the formula must evaluate to TRUE. For more information, see Formulas in Help.

Example: =[Discount]<[Cost] will only pass validation if column Discount is less than column Cost.

For this example I created two currency columns GrossSalary and Netsalary and my formula is that Net salary should be less than Gross Salary. 
I entered 20000 as Gross and 30,000 in Net Salary so the error message is visible in the status pane.  The different between column or field validation and Item validation is that the wrong value message in field will be visible in front of columns.
imageVery impressive 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s