Thursday, December 31, 2009

Modify the default scope for your search drop-down in SharePoint 2007

Today I got asked how to modify the search box on a MOSS site so that it displayed "People" by default in stead of "All Sites". The customer already figured out a way to do this with code, but they weren't 100% sure about it. I had to search for this myself too, cause to be honest, I hadn't done this before, even though I'm already working with SharePoint for almost 3 years now... That's why I'm making this short post, so that all the other people who are trying to do this, know how easy it really is.

To modify the default scope, go to your home page and navigate to "Site Actions” --> “Site Settings” --> “Modify All Site Settings". On this page, pick "Search scopes" under the Site Collection Administration. Here you'll see some different "Display groups", one of them is the "Search Dropdown", which is the search box you see on your SharePoint site. If you click on the "Search Dropdown" link, you'll be taken to a page with some settings for this group and the bottom one is where you set your default scope. So modify this to whatever you want, click OK and you're done!

Workflow fails to start when associated to a survey list in WSS 3.0

The status of a workflow appears as "Failed to Start" when you try to start a workflow from a survey response in Windows SharePoint Services 3.0

Refer this knowledge base article. It seems to be a known issue at MS - http://support.microsoft.com/kb/926370

How to edit list forms like NewForm.aspx, EditForm.aspx and DispForm.aspx in MOSS?

Most common question among SharePoint customization is that
“Why Edit Page option is not available in list forms like NewForm.aspx, EditForm.aspx and DispForm.aspx?”

If we need to edit New/Edit/Display Form of list most of the time we are using SharePoint designer.

But here is the one nice trick to achieve this functionality.

Just add “&ToolPaneView=2” at the end of the URL and refresh the page.

So that you’re URL will be like this.
http://yourMOSSserver/... /Lists/Demo/NewForm.aspx?RootFolder...&Source=…&ToolPaneView=2

http://yourMOSSserver/... /Lists/Demo/EditForm.aspx?RootFolder...&Source=…&ToolPaneView=2

http://yourMOSSserver/... /Lists/Demo/DispForm.aspx?RootFolder...&Source=…&ToolPaneView=2

You can see add webpart tool pan beside this web part.



Just add or remove your webpart and your work is done.
cheers

Below contents are Update as on 22/07/08

There is one more parameter with the same name just pass the value 3 with that.

So that you’re URL will be like this.

http://yourMOSSserver/... /Lists/Demo/NewForm.aspx?RootFolder...&Source=…&ToolPaneView=3


And that will take you to this type of page.



This will allow you to search webpart across all available galleries

Cheers once again...

Wednesday, December 30, 2009

Limiting the number of survey responses

Hi All,

In this article, I am going to share one very important aspect of survey. Many times we require limiting number of responses from survey. However SharePoint does not provide us with the facility to limit the number of responses.

Ok, then how to achieve this? Here we go, follow these simple steps and you are good to go.

(1) Write one web part and write one code which checks for the total responses for specific survey. Add this web part on NewForm.aspx and overview.aspx, all responses and graphical summary of the survey. You get NewForm.aspx when you click on respond to the survey button.

(2) Write down simple code, check URL, if NewForm word exist, then just count the total number of item in survey and if it exceeds let’s say 30 responses, and then redirect back to Source parameter.

(3) If in URL overview, allitems or summary exist, just count the total number of item in survey and if it exceeds let’s say 30 responses then write a statement saying you are not allowed to respond because it has already reached to the maximum responses.

Your job is done.

Time Spanning the "!New" Indicator in Sharepoint 2007


Here we are explaining a way, how to change “!New” indicator time span.

Below is the command to change the time of “!New” label of SharePoint Item

stsadm.exe -o setproperty -pn days-to-show-new-icon -pv <> -url [Your Virtual Server's URL]


To turn off the “!New” icon, set the number of days to zero

Here is the MSDN KB link for the same.

The change is for ALL list items (not just documents) on the virtual server
Good thing is it does not required IISRESET

Coloring Events on a Sharepoint Calendar

Hi All,

We all are familiar with coloring events in Outlook calendar. Question is can we have the same deal with SharePoint calendar and the answer is yes we can have. In this article, I am going to share few tips on how to achieve this functionality.

To achieve this, first create one field in Calendar list. For example, give it a name “Category”. Your each event is divided in some category. Give it as choice column and enter following categories for selection choice.



So, your each event is divided in these two categories. So now, go ahead and add two entries in calendar. One of Sports and other is of important meeting category.



Also create one more calculated column called “CatTitle”



And change the calendar view to this



And now we will add one content editor web part below calendar web part. So Edit the page and add one content editor web part and add the following line of code. This will color the different events.





I would like to thank Mark Wilson for this wonderful trick.

That's it. your job is done.

Thursday, December 3, 2009

Windows SharePoint Services (WSS 3.0) Search Error Fix

Event Type: Warning
Event Source: Windows SharePoint Services 3 Search
Event Category: Gatherer
Event ID: 2436
Date: 2/25/2009 Time: 12:35:04 PM
User: N/AComputer: YOURMOSSSERVER
Description:
The start address cannot be crawled.

Context: Application 'Search index file on the search server', Catalog 'Search'
Details: Access is denied. Check that the Default Content Access Account has access to this content, or add a crawl rule to crawl this content. (0x80041205)

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.


Resolution:
Follow these steps to Disable the loopback check which is causing the error:
Click Start, click Run, type regedit, and then click OK. In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

Right-click Lsa, point to New, and then click DWORD Value. Type DisableLoopbackCheck, and then press ENTER.

Right-click DisableLoopbackCheck, and then click Modify.
In the Value data box, type 1, and then click OK.

Quit Registry Editor, and then restart your computer.

See the following knowledge base article from Microsoft for full details on the error and another possible resolution:
http://support.microsoft.com/kb/896861

SharePoint V3: Stsadm.exe Simple Backup Script

Create Backups Directory
Create a backup directory for storing the scheduled SharePoint backups (e.g. c:\backupsharepoint)

Create Bat File Directory
Create a directory for storing the backup script file (e.g. c:\scriptssharepoint)

Create Bat File
Create a bat file using the code below, modified for your environment. Use UNC paths when using in a server farm environment.

@echo offecho ====================================================
echo Backup Script For Office SharePoint Server 2007
echo ====================================================
cd \program files\common files\microsoft shared\web server extensions\12\bin
@echo off
stsadm.exe -o backup -url http://servername/ -filename c:\backupssharepoint\backupsharepoint.dat -overwrite
@echo off
echo completed

Schedule bat fileSchedule the backup to run frequently, during off peak hours.
Open Start > Programs > Accessories > System Tools > Scheduled TasksAdd a Scheduled Task
Scheduled Task Welcome Screen, Click NextClick the program you want Windows to run, Click Browse
Select the backupsharepoint.bat file you created (e.g. c:\scriptssharepoint\backupsharepoint.bat)
Name the task, Schedule it (e.g. Daily)
Start Time, Frequency, Start Date
Username and Password (use a domain user account that has proper permissions and non expiring password )
Finish

Verify Backups
Keep the backup directory secure. Monitor the job to ensure the job is running properly. Perform test restores from the backup files.

Saturday, April 25, 2009

Lil Tidbits of My Life!!!


Ah! Honestly, people, it takes a lot of effort to make myself write. But the problem is I am not able to stop myself once I get into it. So what am I thinking about today?

I read a beautiful line somewhere. “Never take life too seriously. Nobody comes out of it alive anyway!” So you see, we spend our entire lives dodging the inevitable but one fine day you finally face the thing that has been chasing you since the day you were born and then you are free to sleep without any interruption from the mobile alarm (2 mobiles if you are on IT support) or your maidservant or doodhwala. Well, I have successfully dodged the inevitable for another year in this lifetime. Also, this happens to be a very special year because I will be completing three years over a quarter of a century and I expect to achieve the quarter feat at least three more times.


But then this makes me think about my life so far. Has it been good? Have I done any justice to it? Have I been a good son(umm…interesting question!), a good brother(well, this is the best I could be to her), a good friend (no comments!), a good hubby(Umm ... well ... trying to), a good student (definitely not!), a good professional (hehe..you gotta be kidding)?

Okay! It all started when I troubled my mom for the first time by disturbing her sleep on a reasonably cold night. March(s) are pretty warm in Bagalkot, a remote town in Northern Karnataka, at least they used to be a quarter century back. I have mentioned in my earlier posts that I am a lazy person and I was too lazy to even to be born. My parents were waiting for me for a complete week. They thought that I would remain in my mom’s womb for the rest of my life. But I finally decided to open my eyes to this beautiful world. I am told that my dad was in tears when he saw me for the first time. I hope it was because of euphoria and not because of a rude shock! :-D Well there are many legends surrounding my birth. One being my dad was in tears, another one being I used to look like a chipkali (many believe I still do!) and the most sensational and popular one being that I was picked up from a naali. :- Why do all the parents in this world have to crack that pathetic joke! I will never do it to my kids (or maybe I would. it is a nice way to annoy them! :-D).

And since then it has been a journey. Sometimes I had company, at other times I was alone. Sometimes I wished I had company, at other times I wished I were left alone. Some people made my life look ordinary; some others made mine extra ordinary. There were moments when the entire world seemed to be at my feet; and then there were moments when I was brought down to my feet. There were days when I could relax (the entire semester would be time to relax and idle) and then there were those that made me work like a donkey (it happens a lot in IT). There have been people who trusted me and then there were those who broke my faith. Some were funny; some made me look funny. It has indeed been a mixed bag and maybe that is how life should be. Of all the good and bad things that have happened, I think this life has been worth living for. :-)

After living for such a long time, I still don’t know what is that one thing that is waiting for me. I still don’t know what I want to be, where I want to be. Recently a friend questioned on his blog – how many of us start with a single most aim and work towards it till the end? Well, there might be some who do, but I do not fall in that category. I achieved some unexpected things at times and failed miserably at others. But did I learn my lessons? Umm.. I think yes. I might be adamant at times to accept and follow them, but I have learnt them, definitely. My life has followed the path in the following lines..

"Apni marzi se kahan apne safar ke hum hain…
Rukh hawaaon ka jidhar ka hai, udhar ke hum hain.."

I have no regrets, though, I would try not to make the same mistakes again. And life has been kind to me to give me some important support systems throughout – my parents, my sister, my darling wife and some extremely good friends.


And special mention about three very special people who have taught me the ways of living. I would have been a very different person without these three and I want to say THANK YOU. One will definitely read this and the other two most probably will not!