Skip to main content

Posts

Showing posts with the label SharePoint 2010

Another Reason for 'Group can not be found' error in SharePoint 2010

Recently I was working on an workflow where I was accessing a group from SharePoint 2010 and from there trying to get user's mail ids. I created a group in SharePoint 2010 from UI. Since this group was supposed to hold only users (approvers for workflow), I did not assign any permission to the group. I left all the check boxes unchecked. Next when you try to get the group from code in workflow, you will get error saying 'Group can not be found'. Below is the code I had written in my VS 2010 workflow. SPGroup spgApprovers = workflowProperties.Site.RootWeb.Groups["Some Group"]; After some googling, I found that if you have not assigned any permission to the group, it will not show up in the code. So I went back to the group, deleted it and recreated with reader permission. Hope this will help someone... Happy SharePointing... -Vighnesh Bendre

Validation before Save in New or Edit form

If you want to do validation based on other column in your out of the box New or Edit form, you can do it using JQuery in SharePoint 2010. In the code below I am trying to validate a text column if the value in the status drop down list is ‘In Process’. The function PreSaveAction() gets fired when the user clicks on ‘Save’ button in the New or Edit form. In this function you can create object of the drop down list and text control and check if the text control is empty when the status is ‘In Process’. function PreSaveAction() { var selectedVal = $("select[title='Status']").find('option:selected').text(); if(selectedVal == 'In Process') { var chrgtoNum = $("input[title='SID Number']").val(); if(chrgtoNum == '') { alert('Please enter SID Number.'); return false; } else{return true;} } else {return true;} } You can see my other blog to learn h...

Validation or control form from JQuery - Default New and Edit forms

When you create a custom list, you get default edit and new forms with it. So when you are entering data or modifying it SharePoint provides you a form in a popup that enables you to enter or modify data. But then, if you want to add custom features to the new or edit form, you can do so using JQuery. In the below example, based on the valued selected in the dropdown list, I want to enable or disable other control. And I want to add this JQuery code to the New and Edit forms of the custom list. function HideColumn(stat, active) { var activeObj = $("input[title='" + active + "']"); //initially when the user opens the form, we need to check if the user has selected the status that we have written code for… //if selected value is other than Suspend, disable the control var initialVal = $("select[title='"+ stat +"']").find('option:selected').text(); if(initialVal == '...

How to find out used storage space by SharePoint list or library

Recently, I encountered a problem where my site's data was growing rapidly. I wanted to find out which list or library is using how much disk space (storage). I found out an easier option to list all the lists/libraries in the site and their corresponding storage space.  You just have to append " _layouts/storman.aspx " at the end of your site address. But when I checked for the first time, the data was not accurate. But then I saw a message at the top of the page which said data displayed may not be up to date. Revisit the site to get more accurate data. So when I revisited the page. I was able to get accurate information.  This might help some one... -Vighnesh Bendre

Creating Continuous Integration in TFS 2010 for SharePoint 2010 projects

Setting up Continuous Integration for the code in a project is a common procedure followed in projects. The Continuous Integration (CI) becomes more important in development projects using Agile methodology or for geographically distributed teams. You can create build definitions in Team Foundation Server (TFS) 2010 to build your codebase. But the important question is – how do you setup CI for SharePoint projects? Because by TFS 2010 build agent will not be able to compile SharePoint code. This is because SharePoint code refers to the SharePoint assemblies. And these SharePoint assemblies are not available in the server where the TFS is configured. You could ask why don’t we just install SharePoint 2010 on the same server as TFS 2010. Installing SharePoint 2010 on TFS 2010 server is not recommended for performance reasons obviously. So, the easiest way to successfully compiling SharePoint 2010 code on TFS 2010 server is to copy the SharePoint 2010 assemblies on the build server. ...

Migrating list or library from SharePoint 2007 (MOSS) to SharePoint 2010

There are many situations when you want to migrate data from SharePoint 2007 (MOSS) to SharePoint 2010. Microsoft has provided lot of material on upgrade or migrate to SharePoint 2010. This is the best starting point. I also have written about the steps to upgrade or migrate TFS 2008 team portals to TFS 2010 team portals. Basically I have considered upgrading and migrating from SharePoint 2007 to SharePoint 2010. You can find the blog post here ... But a situation may also arise where you are required to migrate only certain lists or libraries. In this blog post we will see how you can migrate only certain lists or libraries. The approach for migrating SharePoint 2007 lists and libraries is to save them as list templates with content and migrate them to SharePoint 2010 site. But unfortunately SharePoint 2007 list templates (version 3) are not supported in SharePoint 2010. For this reason, we have to convert SharePoint 2007 list templates to be SharePoint 2010 compatible. Fo...

Upgrade and Migration for SharePoint Foundation 2010

      1.1 Introduction Microsoft SharePoint Foundation 2010 has been designed for scale and performance and as such requires new hardware and software requirements. There are 3 major steps while upgrading. 1. Plan and Prepare 2. Perform a database attach upgrade 3. Verify upgrade 1.2 Plan and Prepare   Before we run any process to upgrade from Windows SharePoint Services 3.0 to Microsoft SharePoint Foundation 2010, we have to determine which upgrade approach to take. In our scenario, Database Attach Upgrade seems to be appropriate approach to follow. We can upgrade the content for the environment on a separate farm. The result is that you do not upgrade any of the services or farm settings. You can upgrade the databases in any order and upgrade several databases at the same time. While each database is being upgraded, the content in that database is not available to users. 1.2.1 Upgrade Approach A database attach upgrade enables you to move to...

Site Migration using PowerShell - SharePoint 2010

      The content migration APIs provide a simple but flexible solution for migrating content between SharePoint Foundation Web sites. You can export the content from a SharePoint site, along with any dependencies (for example, security, roles, versioning, and other metadata), into single or multiple XML-formatted files called content migration packages. On import to the destination Web site, the packaged data is extracted and interpreted. You can also save the packages to a file server before migrating to a different server.   The object model is designed to work with data ranging from an entire Web site to an item in a list or library. You can select the level of metadata to include with migrated content, as well as choose whether to do a full migration or only an incremental change.   Following are some common scenarios for using the content migration APIs: Publishing content from a development server to a staging server and from a staging server to ...