Thursday, September 3, 2009

Redirect to a custom page once survey completed

Solution 1:

You can change the default view (the default is overview.aspx) for the Survey list in SharePoint Designer:
Right click on the list
  • Choose properties
  • Go to the Supporting Files tab
  • Change the default view page

Solution 2:

For same scenario, you can create a custom new form for the survey using SharePoint Designer: 
  • Open survey in SPD, in the page to view and manage setting for the list, click New button on Forms section;
  • Enter the file name and select "New item form" as the selected type of form. Check "Set as default form for the selected type". Choose "survey" as the content type
  • Click "OK" and a new form is created.
  • Open the custom form, delete the default “Finish” button.
  • Select “Insert” menu at the top of the page>select “SharePoint” from the ribbon>select “Form Action Button” from the SharePoint controls.
  • In the Form Actions, select  the two actions “Commit” and “Navigate to page”
  • Select the “Navigate to page” action, click “settings” to set the target page : http://sharepoint/pages/thankyou.aspx

Solution 3: SharePoint 2007 - Survey removing save button

You will notice save botton in sharepoint surveys when using sharepoint surveys with branching options. It confuse most of surveys users as generally user select save instead of next or finish which result in in complete surveys.
We have checked a lot in sharepoint options and failed to find any option thay may allow admisitrator or pulisher to disable this buton and find that there is one work around using sharepoint designer for removing it.
  • Open site in sharepoint designer
  • Go to you subsite and expand pages under survey (created earlier with branching option)
  • Open newform.aspx and find following: 
  • Add following JavaScript before closing tag of the content place holder searched in last step:
  • Above script will search for save button and toggle its visibility. If you need to remove save button while editing existing responses you will have to repeat above steps for editform.aspx.

Tuesday, June 30, 2009

Backup Restore in Server Farm (Recover disaster in MOSS)

This post will help you when your SharePoint Central administrator site has got disappeared suddenly from IIS / not opening or corrupted yet all rest of the sites are working well.
Following solution will also let you know, how to take farm backup in SharePoint Server farm?
Ok guys then you need to follow the following steps to get it back.
First take full backup of your farm.
To take a backup of your farm when you have suppose two SharePoint Servers and One database server
1. Server A at 192.168.1.1 IP
2. Server B at 192.168.1.2 IP
3. Database Server C at 192.168.1.3 IP
So create one folder at Server B (192.168.1.2) C:\Backup name it “Backup” right click it and Share this folder and give rights to “Every one user”.
stsadm –o backup –directory -backupmethod
Fire command stsadm –o backup –directory file://192.168.1.2/c$/backup -backupmethod “full”
Here, we are taking backup for our safety so that we can recover if any thing wrong happen.
Ok, good after taking backup take a backup of your all virtual directories because next step is to run SharePoint configuration wizard so it may replace your web.config in virtual directories so it is safe to take backup of virtual directories.
Now run SharePoint configuration wizard on any server. Select use existing server farm and select the same configuration database let wizard finish all steps.
Cheers, hope it will work for you.
Let us know your feedback through comments or mail us if this solution works for you it will encourage us to write more articles.

Backup and Restore Site Collection in MOSS 2007

Here are the stsadm commands that will be useful to backup and restore site collections in MOSS.
Backup Site Collection
First go to command prompt and set the following path:

c:\program files\common files\microsoft shared\web server extensions\12\bin

This is the folder in which the stsadm.exe is present.
After setting this path write the following command:

stsadm -o backup -url http://servername:portnumber/sitecollectionName -filename
pathofDestinationFolder/NameofBackupFile

You will need proper rights on the content db to take backup
Restore Site Collection
Set the path as shown in the above example.
After setting the path the process is:

I am taking an example of restoring collaboration portal. Before executing the restore command create a web application and create a site collection with collaboration portal as site template. Here is the command:

stsadm -o restore -url http://servername:portnumber/sitecollectionName -filename pathOfBackupFile -overwrite
writing -overwrite is mandatory else it will give error.
Again you will need proper rights on the content db to execute restore command.

How to publish a sites in SharePoint Designer 2007

• Start SharePoint Designer 2007, Expression Web, or FrontPage 2003, and then open your Web site.
• On the File menu, click Publish Site.
• In the Remote Web Site Properties dialog box, click File System under Remote Web server type.
• In the Remote Web site location box, use one of the following procedures:
• Type the location of the remote Web site that you want to publish folders and files to.

For example, type C:\My_Website, or type \\MyNetworkShare\My_Website if the location is on a file server.
• Click Browse to locate a folder on your hard disk or on a file server.
• To configure the properties of the Web site, use either of the following methods:
• To remove specific types of code from Web site pages as they are being published, click the Optimize HTML tab, and then select the options that you want.
• To change the default options for publishing, click the Publishing tab, and then select the options that you want.
• Click OK.