9/2/2014 11:46:15 AM
   
Logo - Sports
               
 

Sharepoint 2013 : Enforce Custom Validation on a Column

8/14/2013 9:30:53 AM

Scenario/Problem: You want to set more complex validation rules on a column. For example, in a single text column, you might want to prevent users from entering certain words, such as the word test. Or you might want to make sure the user filling in the form types I agree before submitting the form to make the user think twice before submitting it.


Solution: Most column types support a rudimentary type of validation, allowing you to select whether the column must have a value (in most cases). Some columns are even more specific, requiring you to, for example, specify a minimum and a maximum for a Number column. However, sometimes you need more validation options than are available.

Some SharePoint columns support a formula-based validation mechanism similar to Microsoft Excel formulas. This mechanism is available for columns under the Column Validation heading, and this heading is collapsed by default. Expanding this section reveals two additional settings that you can set for the column.

The first option is the formula. Here you can type a formula that is evaluated when the user tries to save the value for that column. For example, you can add a formula to prevent the word test from being used as a value:

=[column_name]<>"test"

In this example, you replace column_name with the name of the actual column you are validating, as shown in Figure 1.

Image

FIGURE 1 Setting custom column validation on a text field.

The second option you can set in this section is the message that is displayed to the user when validation fails. For example, you can write The term “Test” is inappropriate for the Title of an announcement. This message is displayed to the user below the column in red text, as shown in Figure 2.

Image

FIGURE 2 The column validation prevents a user from submitting an announcement with the title Test.

You can also enforce validation based on comparison between two columns. 

Top Search
sportstoday.us  
- Sharepoint 2010 : Querying SharePoint Data
- SQL Server 2012 : Optimizing SQL Server Memory Configuration - Min and Max Server Memory, Optimize for Ad-Hoc Workloads
- Developing Workflow Applications for Sharepoint 2013 (part 2) - Visio Professional, SharePoint Designer, and Workflow
- Sharepoint 2013 : Configuring Enterprise Search (part 1) - Scaling Out Topology
- Sharepoint 2013 : Working with PowerShell (part 3) - PowerShell and SharePoint - Web Applications, Site Collections, Memory and Disposal
- Windows Phone 8 : Services - Web Services
- Sharepoint 2013 : Choose a Column Type (part 5) - Hyperlink or Picture, Rating Scale
- Sharepoint 2013 : Remove a Content Type from a List or Document Library
- Windows Small Business Server 2011 : Configuring WSUS Using the Windows SBS Console
- Sharepoint 2013 : Create a New Folder in a Document Library, Create a New List, Create a New Survey
Others
sportstoday.us  
-  Sharepoint 2013 : Add a Site Column to a List or Document Library
-  BizTalk Server 2010 : Testing BizTalk application — BAPI walkthrough
-  BizTalk Server 2010 : Building a BizTalk application — BAPI walkthrough
-  BizTalk Server 2010 : Testing BizTalk application — RFC walkthrough
-  BizTalk Server 2010 : Building a BizTalk application — RFC walkthrough
-  SQL Server 2008 R2 : Understanding Index Structures (part 2) - Nonclustered Indexes
-  SQL Server 2008 R2 : Understanding Index Structures (part 1) - Clustered Indexes
-  SQL Server 2008 R2 : Understanding Table Structures
-  SQL Server 2008 R2 : Data Compression (part 3) - Implementing Page Compression, Evaluating Page Compression, Managing Data Compression with SSMS
-  SQL Server 2008 R2 : Data Compression (part 2) - Page-Level Compression, The CI Record
 
- Windows Server 2012 : Using Resource Metering
- Volkswagen CC GT – The Appliance Of Science
- Managing Windows Server 2012 Storage and File Systems : TPM and BitLocker Drive Encryption (part 4) - Introducing BitLocker Drive Encryption
- Sharepoint 2013 : Change the Document Template for the New Button in a Document Library
- The Audi RS6 Avant – Rolling Thunder (Part 3)
- LINQ to SharePoint and SPMetal : Demonstration Scenario (part 5) - Creating Entities Using SPMetal - Create a Windows Forms Sample Application
- Sharepoint 2010 : Backup and Restore Options (part 4) - Central Administration Backup and Restore Tool - Using the Restore Utility
- Field Of Dreams (Part 4) - Honda Fit EV
- Mercedes-Benz 300 SLR - The Power And The Glory (Part 3)
- The Chrysler 300C 3.0 DCR – Magnanimous Monolith (Part 2)
 
 
  • STANDINGS, FIXTURES AND RESULTS
 
 
  • World Ranking
 
 
 
sportstoday.us