Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Reviewing the Column Choices in SharePoint 2010 (part 2) - Leveraging Validation Settings & Enforcing Unique Values in Columns

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
3/29/2011 4:16:41 PM

Leveraging Validation Settings

Another means of ensuring that the correct data is entered into columns in a list and library is through the use of validation settings, which can be added to the list or library on the List Settings or Library Settings page, or to an individual column. The equations that can be used are more limited, as the result of the equation must equal the value True or the user won’t be able to save the entry.

A simple example is

=[ColumnA]>[ColumB]

Assuming the value in ColumnA is greater than ColumnB, the formula generates the value True and therefore passes the validation test.

Building on the list created in the previous section, follow these steps to add validation to the CalculatedColumnTest list:

1.
Navigate to the CalculatedColumnTest created in the previous section that contains the columns Title, Cost, and Sell Price, as described in the example, as well as sample data, as shown in Figure 22.6.

2.
Click the List tab on the Ribbon, and then click Create Column.

3.
Enter Invoice Number as the column name, and then choose Single Line of Text.

4.
Scroll down to the Description field and enter Enter a valid invoice number starting with "2010-" and then up to 4 digits.

5.
Click Enforce Unique Values.

6.
Enter 9 for Maximum Number of Characters.

7.
Expand the Column Validation section by clicking the + and enter the following in the Formula field:

=FIND("2010-",[Invoice Number], 1)

The FIND function is also defined in Excel 2010 Help, and the syntax translates to “FIND(find_text, within_text, [start_num]),” or in this example to “Find the string 2010- in the column Invoice Number, starting with the first character in the string and the value is True.” This logic is pretty hard for a careless or even malicious user to beat because there is a limit of nine characters that can be entered in the field and it must include the string 2010-. Furthermore, the entry must be unique.

8.
Finally, enter the following in the User Message field: You have entered an invalid invoice number (see Figure 2). Click OK to save.

Figure 2. Column settings for a column using column validation.

9.
Click OK to the message stating: “This column must be indexed to enforce unique values. Do you want to index this column?”

10.
Click Add New Item and enter the title as Whoozit, the Cost as 100, the Sell Price as 150, and Invoice Number as 123456789. Click Save. A red error message will display, stating “The validation formula has evaluated to an error,” as shown in Figure 3, because this invoice number doesn’t meet the validation.

Figure 3. Validation formula error for a New List item.

11.
Reenter the invoice number as 2010-123 and click Save; this time the entry succeeds because it meets the validation requirements.

Enforcing Unique Values in Columns

Certain column types offer the option to Enforce Unique Values for the column. This is a capability that has been requested by many clients over the years, and various workarounds were developed using workflows or leveraging the ID value of the list item. For example, a list that tracks serial numbers, employee IDs, invoices, or many other values will be less valuable if data entry errors can lead to nonunique numbers.

Table 1 summarizes what column types can and cannot be used to create unique columns.

Table 1. Unique Column Options
Supported Unique Column TypesUnsupported Unique Column Types
Single line of textMultiple lines of text
Choice (single value)Choice (multivalued)
NumberCalculated
CurrencyHyperlink or Picture
Date and TimeCustom Columns
Lookup (single value)Lookup (multivalued)
Managed MetadataPerson or Group Yes/No

Caution

If Content Approval is enabled for a document library and then unique values are enabled, a warning note displays that “This list or document library has content approval enabled. A column that enforces unique values may let users determine information about a list item or document even if they do not have permission to view it.” This is logical because when a user sees an error about the item not being a unique value, she can deduce that there already exists a list item with that value.

Other -----------------
- SharePoint 2010 : Working with Metadata in a Word 2010 Document and Document Libraries
- Windows Server 2008 Server Core : Configuring Directory Services - Creating New Objects Using the DSAdd Utility (part 2)
- Windows Server 2008 Server Core : Configuring Directory Services - Creating New Objects Using the DSAdd Utility (part 1)
- Exchange Server 2010 : OWA (part 2) - OWA Virtual Directory Properties & Exchange Control Panel
- Exchange Server 2010 : OWA (part 1) - Configure File Access and WebReady Document Viewing & Segmentation Settings
- Exchange Server 2010 : Configuring Client Access - Outlook Anywhere and RPC Clients
- Windows Server 2008 R2 : Deploying and Using Windows Virtualization - Quick Migration and Live Migration (part 3)
- Windows Server 2008 R2 : Deploying and Using Windows Virtualization - Quick Migration and Live Migration (part 2)
- Windows Server 2008 R2 : Deploying and Using Windows Virtualization - Quick Migration and Live Migration (part 1)
- BizTalk 2010 Recipes : Document Mapping - Using Inline XSLT
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server