Tuesday, December 27, 2011

The transaction log for database 'SharePoint_Config' is full

Scenario: Tried to change web application settings from Authentication Providers page from Central Administration

Problem: Received the error "The transaction log for database 'SharePoint_Config' is full" when tried to save the updated settings.

Resolution: Found that the drive that containing the config database log is having very few space remaining.
Following steps helped to resolve this issue

1. Do full backups of all the SharePoint databases.  
2. Open the database, right click SharePoint Config database > Properties
3. Select Simple under Recovery model list > Click OK
4. Right click the database,  Tasks > Shrink > Files
5. In File type select Log
6. Click OK

Refer to the following post for more information

Monday, October 31, 2011

Your backup is from a different version of Windows SharePoint Services and cannot be restored to a server running the current version. The backup file should be restored to a server with version '12.0.0.6535' or later.

I tried to backup and restore a site collection from our production server to development. Our production is MOSS 2007 64 bit and Development is MOSS 2007 32 bit.

I got the following error when tried to restore the backed up file

"Your backup is from a different version of Windows SharePoint Services and cannot be restored to a server running the current version. The backup file should be  restored to a server with version '12.0.0.6535' or later."

When I checked the version of each SharePoint site Site Actions > Site Settings, both had different versions. In order to have a successful restoration, we need to sync both the SharePoint versions.

Site Version

We were having version 12.0.0.6535 in production and 12.0.0.6421 in development.


I have fixed the issue by installing KB983444 which brought the MOSS 2007 to version 12.0.0.6535.
Run the Config wizard after  patch/hotfix/kb applied.

I'm able to use stsadm to restore from my backup into the new MOSS 2007 site.

Reference:
http://technet.microsoft.com/en-us/security/bulletin/MS10-039

http://www.microsoft.com/downloads/details.aspx?familyid=3841ceda-d0af-4e5e-8a1a-7dd954850783

Monday, October 24, 2011

The file '/_Layouts/Bamboo.ProjectPortfolioDashboard/HandleDataForCharts.ashx' does not exist.


Issue: We have installed the Bamboo's Project Portfolio Dashboard solution in our production environment without any issues, however, when we add the Web Part, the images in the Web Part were not loaded and getting the following error

The file '/_Layouts/Bamboo.ProjectPortfolioDashboard/HandleDataForCharts.ashx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.SimpleHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

Note: Our SharePoint site is SSL enabled. The WebPart is working in http and not on Https. When contacted Bamboo we have been told that the issue is not with their setup and it is with our environment.

Resolution: We checked that the file HandleDataForCharts.ashx does exist at the _layouts folder. We finally found out that an HttpHandler entry is missing in the web.config file

We were able to  resolved the issue by adding the following web.config entry under <httpHandlers> section

<add verb="*" path="*.ashx" type="Bamboo.HandleDataHelper.HandleDataForCharts" validate="false" />

The following link http://msdn.microsoft.com/en-us/library/bb515343.aspx helped us to resolve the issue

Friday, September 30, 2011

Create multi level approval workflow in SharePoint 2010 using Visual Studio


Requirement: We have a requirement to create a Multi-level approval workflow for document libraries. I need to use SharePoint groups for each level of approval/review as there are multiple users need to review the document and approve and don't want to hard code the SharePoint groups. Can we create a custom workflow section where I can set the 'level of approvals' and 'Approvers' for each level when assigning a workflow for a document library

Solution: Create a workflow association page using VS.NET 2008. Refer to my previous post for more info.

Attached the screen shots of final output
Page 1:
Create Multi-level Approval Workflow

Page 2:
Create Multi-level Approval Workflow

The codebehind page of the association page (aspx page) will have the code to create SharePoint groups for "Reviewers"(1st level approval) and "Approvers"(2nd level approval) on submit. All the workflow related activities is handled in the Workflow coding.



Trigger event when workflow is added to a document library

Requirement:  I've created a custom sequential workflow using Visual studio and wanted to create SharePoint group when the workflow is added to a document library.

Issue: There is no event or activity associated to the Workflow which will be triggered when we add a Workflow to a document library of list. Also there is no event associated with document library or list that to be triggered when a workflow is added to it.

Solution: Create an association and initiation form in a workflow using VS.NET 2008. You can use either .aspx or InfoPath forms in a workflow. Association and initiation forms are displayed for users to complete before any workflow actually starts.Association forms are displayed to administrators when they first decide to add or associate a workflow with a particular list, document library, or content type. You can use association forms to let an administrator specify parameters, default values, and other information for the workflow as it applies to items on the list, library, or content type with which the administrator is associating it.

Below are some excellent resource I referred to and implemented successfully. Please refer to
http://msdn.microsoft.com/en-us/library/cc297199(v=office.12).aspx

Workflows for WSS3 Demystifying ASPX forms association

http://sergeluca.wordpress.com/2008/11/20/step-by-step-tutorial-creating-workflows-with-windows-sharepoint-services-and-moss-2007-part-1420-easy-aspx-association-forms-my-small-generic-framework/


Sunday, August 28, 2011

Insert a Sharepoint list item from web services


The following code is used to insert an item to a list using SharePoint Web Services.

        /// <summary>
        /// Method to insert picture URL to a list
        /// </summary>
        /// <param name="pictureURL">URL of the picture</param>
        /// <param name="currentlLoginID">Current logged in user</param>
        private void InsertItem(string pictureURL,string currentlLoginID)
        {
 
       /*Declare and initialize a variable for the Lists Web service.*/
            spsService.Lists listService = new spsService.Lists();

            /*Authenticate the current user by passing their default
            credentials to the Web service from the system credential cache.*/
            listService.Credentials = System.Net.CredentialCache.DefaultCredentials;
                 
            listService.Url = "http://spsService/sites/MP/_vti_bin/Lists.asmx";

            System.Xml.XmlNode ndListView = listService.GetListAndView("Team Profiles", "");
            string listName = ndListView.ChildNodes[0].Attributes["Name"].Value;
            string viewName = ndListView.ChildNodes[1].Attributes["Name"].Value;


             XmlDocument xmlDoc = new XmlDocument();
         
            /* Declare an XmlNode object and initialize it with the XML response from the GetListItems method.*/
            System.Xml.XmlNode nodeListItems = listService.GetList(listName);

            string sBatch = string.Empty;        
            string uid = "-1;#" + currentlLoginID;

            //Query to insert data
            sBatch = "<Method ID=\"1\" Cmd=\"New\">";
            sBatch += "<Field Name=\"ID\">New</Field>";
            sBatch += "<Field Name=\"User_Picture\">" + pictureURL + "</Field>";
            sBatch += "<Field Name=\"UID\" >" + uid + "</Field>";
            sBatch += "</Method>";

            XmlElement batch_element = xmlDoc.CreateElement("Batch");
            batch_element.SetAttribute("OnError", "Continue");
            batch_element.SetAttribute("ViewName", viewName);

            batch_element.InnerXml = sBatch;
            listService.UpdateListItems(listName, batch_element);
        }

Wednesday, August 17, 2011

List all SharePoint Databases

Before migrating/moving the SharePoint database, we need to find all the database name.

We may need to find move the following database


Databases for Shared Services Providers (SSPs)
Search databases for SSPs
Content databases
Search database
Central Administration content database
Configuration database

To find all the SP database names, Go to Central Administration >> Operations >> Perform a Backup. This will take you to the page with all database listed.