Skip to main content

Posts

Showing posts from 2013

How to show complete errors in sharepoint 2010

Enable Custom Errors: Set the customErrors mode to "Off" <system.web> <customErrors mode="On" /> Change To: <system.web> <customErrors mode="Off" /> Enable the Call Stack Trace: Set the CallStack value of the SafeMode element to "true" <SharePoint> <SafeMode ... CallStack="false" ... > </SharePoint> Change To: <SharePoint> <SafeMode ... CallStack="true" ... > </SharePoint> Enable Debugging Mode: Set batch and debug to "true" Find: <compilation batch="false" debug="false"> Change To: <compilation batch="true" debug="true"> Enable the ASP.NET tracing feature: Include the following line in the <system.web> element of the web.config file. <system.web> <trace enabled="true" pageOutput="true"/> ……. <system.w

Open webpart maintenance directly in SharePoint

At times we would be faced with situation that the page does not load, due to some webpart issue. In SharePoint 2010, there might be a link in the error message to open the webpart maintenance page directly. In certain cases, it is not provided. So to open webpart maintenance page directly from url just append ?contents=1 at the end of the URL of respective page and SharePoint will open the Web Part Maintenance Page for it. For e.g, if the url is http://sharepointserver/sites/pages.aspx, make the url http://sharepointserver/sites/pages.aspx?contents=1 to open the webpart maintenance page. Note - the user need to have edit access on the page to open the webpart maintenance page.

Redirect to a desired page on click of submit/ cancel button in infopath form

By default, when a user clicks on Submit/Cancel button, the InfoPath list form redirects to the AllItems.aspx page of the list. Instead of redirecting the user to the default view of list, to redirect it to the desired page, append the URL of the InfoPath form with &Source=redirect-url http://xyzportal/..../xyzform.xsn&DefaultItemOpen=1 &Source=redirect-url Also, make sure that in the button properties, in the "Browser Forms" tab, "Always" option is selected.

Modify the height of multi-line column in Infopath 2010

In Infopath forms, we can set the height of a multi-line column to be fixed or dynamic. In case if the height is fixed(which is the deafult option), if there are more number of lines than that can be accomodated, a scroll would appear on the text box. This reduces the readability of the content for the user. To rectify the issue,the height can be set as auto(i.e., height would vary depending on the content) or a constant fixed value as per the requirement. Follow the below given steps to do the same. • Open the edit form in InfoPath designer. • Select the multiline column and then Right click on Text Box Properties. • In the properties window that opens, click on the Tab Size. • To set the height as auto, click on the align button available at the end • To make the height to be fixed, make the changes in the Size section for the height property . • Click OK to save the changes and then save and publish the form for the changes to be visible to the user.

Classes available in sandbox solutions in Sharepoint 2010

Microsoft.SharePoint Microsoft.SharePoint.Linq Microsoft.SharePoint.Search Microsoft.SharePoint.Security Microsoft.SharePoint.Portal Microsoft.SharePoint.Publishing Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Common Microsoft.Office.Excel.Server.Udf Microsoft.Office.Server Microsoft.Office.Server.Search Microsoft.Office.Server.UserProfiles Microsoft.SharePoint dll Namespaces available in Sandbox Microsoft.SharePoint Microsoft.SharePoint.Administration Microsoft.SharePoint.Navigation Microsoft.SharePoint.UserCode Microsoft.SharePoint.Utilities Microsoft.SharePoint.WebControls Microsoft.SharePoint.WebPartPages Microsoft.SharePoint.Workflow To know the classes that can be used refer - MSDN

Error: Performance Point Service Appication not configured correctly

When trying to add excel service as Datasource in BI center site, it gives an error “This data source cannot be used because PerformancePoint services is not configured correctly”. To solve the issue, do the steps listed 1. Go to Central admin--> Manage Services --> Secure Store services 2. First time when the secure store services page opens, it says that no keys generated. Click "Generate new key" in toolbar and then step through "targetting" and "set" the key sections 3.Go to "Managed Services" in Central Administration and select the respective PerformancePoint Service 4.Open "PerformancePoint Service Application Settings" and add Unattended Service Account which was configured in step 2 Secure Store Service: - This service application stores the password for the PerformancePoint Services unattended account.

Event handler to copy items from one site to another

The code can be used to copy items from one site to another ,but source and destination sites must be in same server. If the item was added newly in a Document Library , Item Checked In Event Handler must be used :    public override void ItemCheckedIn(SPItemEventProperties properties)        {            base.ItemCheckedIn(properties);            try            {                SPSite sourceSite = new SPSite("Source Site URL");                SPWeb sourceweb = sourceSite.OpenWeb();                SPList sourcelist = sourceweb.Lists["Source List"];                if (properties.ListTitle == sourcelist.Title)                {                    SPListItem sourceitem = properties.ListItem;                    string title = sourceitem["Title"].ToString();                    string description = sourceitem["ToolName"].ToString()";                    SPSite _destSite = new SPSite("Destination Site URL"

Flip Images on hover in Sharepoint 2010

Add a CEWP in the page and then use the CSS class to achieve the hover effect. These images can also be made links. There can be more than one image and put in a table format in CEWP <table width="462" height="250" align="center" style="background-color: black"><tbody><tr><td style="width: 25%"><div class="example one"><div class="wrapper"><a href="#"><img src="<image url>" alt=""/></a> </div></div></td> <td style="width: 25%"><div class="example two"><div class="wrapper"><a href="#"><img src="<image url>" alt=""/></a> </div></div></td> <td style="width: 25%"><div class="example three"><div class="wrapper"><a href="#"><img s

Upload large files (>1GB) in SP2010

The default limit of a single upload file in SharePoint is 50MB. The size limit can be increased upto 2GB, from central admin. To increase the size limit and any issues faced during upload of large files, check the link below http://blogs.technet.com/b/sharepointcomic/archive/2010/02/14/uploading-large-files-to-sharepoint-on-windows-server-2008-and-iis7.aspx As given in the link, it is not recommended to upload large files of size greater than 500MB thru sharepoint. The reason's why large file uploads are not recommended via browser is listed Reliably transferring gigabyte or bigger files without breakages over a protocol like HTTP, which is better suited for tiny transfers like images and text. Not killing your browser because it has to load all that in memory Not killing your web server because All that you upload through HTTP post, first gets streamed into IIS Memory, w3wp.exe memory before the ENTIRE FILE finishes uploading .. before it is stored. Which means,

Enable anonymous access in Sharepoint 2010

·          In Central Administration, under Application Management, click on the Manage web applications. ·          Select the web application you want to enable anonymous access and click on the Authentication Providers icon in the ribbon ·          On the Authentication Providers pop-up window click on the Default zone ·          Under Edit Authentication, check Enable anonymous access and click Save. ·          Go back to Web Application Management click on the Anonymous Policy icon in the ribbon ·          Under Anonymous Access Restrictions select your Zone and set the Permissions to None – No policy and click Save. ·          Once in web application anonymous access is set, the option would come in site collections. Navigate to top level site collection for the web application. Click the Site Actions > Site Settings. Under Users and Permissions click Site permissions. ·          Under Permission Tools, click Anonymous Access icon and set the permissions as requ

Federated Search usage reports

Federated search is a feature in Shareoint 2010, where results from external sites, other sharepoint farms, Local sites in same farm can be queried and results be displayed. On how to configure federated search, refer http://blogs.msdn.com/b/sharepoint__cloud/archive/2012/03/12/configure-federated-search-to-get-results-from-remote-another-sharepoint-2010-farm.aspx Consider a federated search webpart in farm B, where the search results are from Farm A. To know the usage of the federated search, will have to check the reports in source farm (Farm A). Go to central admin - Application Management - Manage Service Application - Click on the search service application On the left pane, Under Reports, click on Web Analytics report The usage report would show the total usage report of the search service application Say the search service application is used by a site collection and also by the federated search So, say it shows 1000 No of queries for the past 30 days. Site coll

Display a Thank You message at the end of survey form in Sharepoint 2010

A quick and easy way to display a Thank you message at the end of survey for submitting the form. At the end of last question, insert a page breaker. After the page breaker, add the Thank you message as a question, and select the type Single line of text. Enter the default value as "Internal". Go to the survey form and click on Respond to Survey. Click Next and in the Editform url in the browser, append &ToolPaneView=2 to the end of URL. Add a CEWP to the below of the page and insert the below code, in HTML source or else paste the code in a text file uploaded to sharepoint library and refer to the text file. (referring the text file is preferred) <script> // hide the input textbox for the "thank you " message  var x = document.getElementsByTagName("INPUT");  var i=0;  for (i=0; i<x.length; i++)  {   if (x[i].value=="Internal")   {     x[i].style.display="none";   }  }  </script> Save the page. Respond to the

Create Export to Excel option for list as button control in page

In Sharepoint 2010, in the list ribbon there is an option Export to Excel, to get the list data in excel format. The same option can be given to the end user on click of a button in the page Create a content editor webpart. In the html source enter the following code <button type="button"  <a href="#" onclick="javascript:window.location='../_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List= ListGuid &View= ViewGuid &CacheControl=1'"><img src="/_layouts/images/icxlsx.gif" border="0"/>&nbsp;&nbsp; Export to Excel</a> </button>

Calculated column tips

Calculated columns is one of the types available in SharePoint. Some important rules and guidelines are as follows: The functions TODAY and ME are not supported in calculated columns but are supported in the default value setting of a column. Arithmetic operators supported include + (addition), - (subtraction), * (multiplication),/ (division), % (percent), and ^ (exponentiation). In Equations parenthesis are allowed. The allowed Comparison operators are  = (equal to), > (greater than), < (less than),>= (greater than or equal to), <= (less than or equal to), and <> (not equal to). & (ampersand) is used to connect 2 values and produce one continuous text value. A value other than the current row cannot be referenced A value in another list or library cannot be referenced. The RAND and NOW functions is not supported in Lists and libraries. Most of the Excel functions are supported in SharePoint calculated columns, but not all.

Examples of utility function in SPD 2010 workflows

In SPD workflows, under Actions, there is a set of Utility functions. Using the substring function, a string can be trimmed from the beginning/end/or from a position, with or without specifying the length. An example, to remove the domain part from the user name, e.g. abcdomain/username, follow the below steps 1.        Use “Extract substring from the index of string” 2.        It would insert a step in WF as “Copy from string , starting at 0 (Output to Variable: substring ) 3.        Click on ‘string’ and click fx to get the field to be trimmed. 4.        It would bring the look-up window. 5.        Select the field and click OK. In this e.g., Data Source: Current Item and Field from Source: Created By 6.        To set the index, click on 0 and enter the required number, here it would be 11. 7.        If the variable name has to be changed, click on ‘Variable:substring’ and change the name. 8.        The value stored in the workflow variable would be ‘username’

Form cannot be rendered error when opening Infopath list forms

While trying to open the InfoPath form created for lists in SharePoint 2010, an error was encountered as given - " The form cannot be rendered. This may be due to a misconfiguration of the Microsoft Sharepoint ServerState service. For more information contact your server administrator" This error can occur if the state service is not activated while creating the web application. To resolve the error, follow the below steps. • Open central admin -- Application management --Manage web applications. In the page that opens select the web application and click on Service connections in the SPRibbon. • The above step will open the Configure Service Application Associations dialog box. Select the State Service and click OK. • Then the configuration wizard must be run to activate the services

Sharepoint 2010 correlation error - Request for security token failed with exception

After windows update, Sharepoint 2010 sites do not come up and shows correlation error. Or, the site comes up but the global navigation and left navigation shows error. On the ULS log when checked it shows - “Request for security token failed with exception: System.ServiceModel.ServiceActivationException: The requested service, 'http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas' could not be activated. See the server's diagnostic trace logs for more information.    Server stack trace:      at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)     at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)     at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)     at System.Servi