Thursday, February 2, 2012

Sharepoint 2010 – New functionalities for listings

Enforce Unique Values in Site Columns Ability

In MOSS 2007, we do not have any option to set unique column value for the field in document library or list. We can still achieve that with the help of event handlers and adding some code in the ItemAdding event. But still there was no direct way to do it.
Now in SharePoint 2010, we have the built in functionality to enforce the uniqueness of the field. But yes do remember that the field must be indexed first before you want to set it as a primary key.
Well, just a quick question. Do we have anything as primary key in MOSS 2007? Yes, we do have and that is ID field in list or library. However that does not solve the purpose as it is just used to identify items and used heavily in coding purpose.
So let’s see how to go ahead with primary key in list field.
Create a list in SharePoint 2010 site and then create a field that you want to have a primary key. Go to list settings. Go to indexed columns and choose that column to be indexed.
When you create a field now then we have an option to enforce the unique value. This can be set only when you have made that column indexed. So if you have not indexed this column, SP 2010 will ask you to do it.
 Once you set this field as unique key, then go ahead and add one value and try to add another with the same. It will not allow you to do so and show the message.

Lookup

SharePoint 2010 offers a lot of new functionality for listings. One of them is “Additional Columns”. So what does it mean?
This means that you create a lookup field from the Annoucement list. But if i want to see the Title and the Expires, simply stick in the check box as the following figure. This is established using so called additional columns.
 

Validation settings

In SharePoint 2010, a new setting point in List and Library settings is available. This point is called “Validation settings”. Validation settings will be very missed in SharePoint 2007, because there wasn’t a way to avoid such easy and daily business related things like dates in the past etc. It seems that this will be worked with SharePoint 2010, but how the feature looks like? In the pre-beta version of SP2010 I work with, you can buil expresions like in calculated columns. I tried the following expression:

And, there’s the trick, I wasn’t able to save the task! Ok, in this version I don’t get the message that was set up in the validation settings, but seems it works! Validation isn’t the newest feature at all, but hey, it’s reeeeaaly usefull!
Hope this help!

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews