Skip to main content

How to give Validate a Due Date in a SharePoint 2010 List

One of the great new features that end-users love in SharePoint 2010 is the ability to validate input. It provides an easy way to make sure that users enter the correct type of data in a metadata field. However, there are a couple questions users often have. The first one is why are there two different places to do it (Column Validation on the Column Settings page and Validation Settings on the List Settings page)? The second question users often have is how can I reference other columns in my validation rules? In this blog post, we’ll answer these two questions from a common case study.

The Problem – How To Disallow a Due Date that is in the Past?
One of the common things people want to do is make sure that people do not set due dates for tasks (or other types of lists) in the past.
Usually the first thing a you will try is to set the validation to [Due Date] > [Today]. This makes sense because you are already use to using [Today] to filter views. However, when you try to do this.

You receive an error telling you, “The formula cannot refer to another column. Check the formula for spelling mistakes or change the column to this column.

So, the next thing you try is to set the field to validate based on the Creation date. So, you change your validation formula to [Due Date] > [Created] and try again:

Unfortunately, this yields the same error message about The formula cannot refer to another column.
A third option you may consider is to use the Today function to create a formula like: [Due Date] > Today().

SharePoint seems to like this formula and correctly displays the error message:

However, there  is a problem with this solution as well. The validation will occur each time someone edits the task. So, if someone edits the task three days from now, this validation will fail unless the Due Date changes to a date later than the current day. Aaarrggghhh!!!!!
The Solution – So, What’s a SharePoint User to Do?
You’ve probably noticed that there are two places you can set column validation. The one you use most of the time is on the Column Settings page. However there is also one on the list settings page. It’s there at the top. You’ve seen it a thousand times and just never noticed it before. Click on that one.

In the Validation Settings link on the List Settings page, you can validate one column against another. Here you can see that I’ve set the[Due Date] > [Created].

If your users attempt to enter a due date that is before the creation date, they will see the message you entered.

So, you’ve learned a couple things. First, there is a distinct difference between the Validate Settings link on the column page and the Validate Settings link on the Column Settings page: the one on the List Settings page allows you to compare columns, while the one on the column settings page doesn’t. Second, the validation error messages from these two appear in different places on the form: validation error messages created on the column settings page will appear in the column section on the form, while validation error messages created on the List Settings page will appear at the top of the form.

Comments

Popular posts from this blog

Tab Control in Asp.Net

Scenerio: I need your help in designing tab control in   asp.net .My requirement is I need a tab control in   asp.net (C#) like  for example goto my computer ,right click c drive and select properties.we get tabs like general,security etc....... like that i need to design one tab control(no need of any rightclick) in my web page and the database table columns should come as tabs and inseide the tab data of that particular column should come.   Example:Employee master tab1:Employee name.........his name in the tab tab2:Age.............his age tab3:Address........his address   Solution:   You can do this using a simple div <style type="text/css"> .tabs         {             position: relative;             height: 20px;             margin: 0;   ...

AI and Microsoft: Revolutionizing Efficiency in Nonprofit Organizations

  How AI and Microsoft Enhance Efficiency in Nonprofit Organizations In today’s fast-paced world, nonprofit organizations face unique challenges—limited resources, increasing demands, and the constant need to do more with less. But what if technology could be the game-changer they need? In my latest research paper,  "How AI and Microsoft Enhance Efficiency in Nonprofit Organizations" , I explore how cutting-edge technologies like Artificial Intelligence (AI) and Microsoft’s innovative tools are revolutionizing the way nonprofits operate. From streamlining administrative tasks to enhancing donor engagement and optimizing resource allocation, AI and Microsoft’s solutions are empowering nonprofits to focus on what truly matters—their mission. This paper dives deep into real-world examples, practical applications, and the transformative potential of these technologies. Whether you’re a nonprofit professional, a tech enthusiast, or simply curious about the intersection of technolo...

Social tagging overview in Sharepoint 2010

A tag is a word or phrase that identifies an individual piece of information according to a set of attributes or criteria. Tags make it easy to find and share information about a specific subject or task. Social tagging helps users categorize information in ways that are meaningful to them. Social tagging can improve the quality of search results by filtering against specific tags, and it can also connect individuals who want to share information with other users who have like interests. This article describes the social tagging features in Microsoft SharePoint Server 2010. This article does not describe how to configure social tagging features. It also does not discuss how to implement social tagging features as part of an overall social media strategy for an enterprise. About using social tagging features Social tagging features help users to share information and to retrieve relevant, high-quality content more efficiently. Such sharing encourages collaboration and b...