Date Validation in SharePoint
Introduction
In this post we will see how to implement SharePoint validations taking example of a scenario. I have observed many users got struck implementing some basic validations. Hope my series of SharePoint validation articles helps everyone to resolve their issues right from basics to advanced.
If you are new to implement validations in SharePoint, please do check this article to understand how we can implement validations http://adicodes.com/column-validations-and-list-validations-in-sharepoint-2010/.
Scenario – StartDate Should be greater than DueDate
I am using following List Columns and their type in the example
StartDate – Date and Time
DueDate – Date and Time
Formula
=DueDate>StartDate
Formula and validation message setting
Formula will be inserted from list settings > validation settings option. This is list level validation as formula involves with two different columns
Validation Message
Conclusion
We will further cover some good scenario’s and hope you will enjoy implementing them wherever required. If you are looking for any specific scenario formula, please post a comment and I will try to provide the formula or I will certainly help you to get it resolved
November 7, 2013
В·
Adi В·
4 Comments
Tags: Column valdiations, List Item validations, SharePoint 2010, validations В· Posted in: Sharepoint 2010, SharePoint 2013, Validations
4 Responses
Hello and thanks for the post
I have done the same but instead of Due date i have End date.
But after validation i cant leave the field blank. I want End date to be blank so that i can enter the value after task is over.
Will be happy if i get some help from you.
Thanks
Hello Bhat,
In your case you have to check if the field is blank before the validation rule fires. If Empty return true or if value is there then check with validation formula. Following will fit to your case
=IF(ISBLANK(EndDate),TRUE,IF(EndDate>StartDate,TRUE,FALSE))
Happy coding.
Regards,
Adi
=DueDate>StartDate
I used the same string above replacing DueDate with EndDate and SharePoint 2013 returns and error code of this message:
“The formula cannot refer to another column. Check the formula for spelling mistakes or update the formula to reference only this column.”
I want people to only be able to schedule in 15 minute increments.
Trying to validate the minutes in the End Time column.
=INT(([End Time]-[Start Time])*1440)<=15
Help!
Leave a Reply