All About SharePoint

Liedong(Ken) Zheng,SharePoint Leader at SIMPLOT

Archive for August, 2011

Change View Error In SharePoint 2010 SP1

Posted by ken zheng on August 29, 2011

The basic problem is :

· User opens form in InfoPath Forms Services

· Changes view

· BOOM – gets an error + correlation id   [Security Validation]

This error was found by Chris O’Connor in our Dev box. So I post here as I need do the same thing to our production servers.

Here is the fix but not a very good option

 http://social.technet.microsoft.com/Forums/en-IN/sharepoint2010customization/thread/6d5ffcb6-7563-4234-9282-e767b56b97b2#e98231d6-68ef-43f1-818e-21469db9badd

Fix is as below:

1.       In the 14 hive, under template/layouts, find the formserver.aspx file.

2.       Backup the file and then edit it with any text tool, say, notepad.

3.       Under the <body> tag, add the highlighted line of code.

<body runat="server" id="PageBody">
<SharePoint:FormDigest runat="server" />

4. Save it. Then the problem should be resolved.

Posted in Sharepoint | Tagged: , | Leave a Comment »

Adding Search Refiners in SharePoint 2010

Posted by ken zheng on August 29, 2011

You can set refiners on your managed property in SharePoint 2010. Once you created Managed Metadata, you need to do is add the following xml to Refinement Panel Filter Category Definition XML file:

image

<Category    Title="SBS"   Description="SBS" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator"    MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="20" ShowMoreLink="True"    MappedProperty="BCSSBS"    MoreLinkText="show more"    LessLinkText="show fewer"    />
image

image

Posted in Sharepoint | Tagged: , , | 3 Comments »

When You Need Full Crawl In SharePoint Search

Posted by ken zheng on August 29, 2011

I often see people schedule full crawling weekly that consume lots of resource and affect the performance.

So when do you need conduct a full crawl?

  • A software update or service pack was installed on servers in the farm. See the instructions for the software update or service pack for more information.
  •  

  • A Microsoft Office SharePoint Server 2007 shared services administrator or SharePoint Server 2010 Search service application administrator added a new managed property. A full crawl is required for the new managed property to take effect immediately. If you do not want the new managed property to take effect immediately, a full crawl is not required.
  •  

  • You want to re-index ASPX pages on Windows SharePoint Services 3.0 or Microsoft Office SharePoint Server 2007 sites.
  •  

  • You want to detect security changes that were made on a file share after the last full crawl of the file share.
  •  

  • You want to resolve consecutive incremental crawl failures. If an incremental crawl fails one hundred consecutive times at any level in a repository, the system removes the affected content from the index.
  •  

  • Crawl rules have been added, deleted, or modified.
  •  

  • You want to repair a corrupted index.
  •  

  • The Search service application administrator has created one or more server name mappings.
  •  

  • The credentials for the user account that is assigned to the default content access account or a crawl rule have changed.
  •  

    The system does a full crawl even when an incremental crawl is requested under the following circumstances:

    • A search administrator stopped the previous crawl.

     

    • A content database was restored, or a farm administrator has detached and reattached a content database.

       

    • A full crawl of the site has never been done from this Search service application.

     

    • The change log does not contain entries for the addresses that are being crawled. Without entries in the change log for the items being crawled, incremental crawls cannot occur.

    here is the link to TechNet that details Plan for crawling and federation

    Posted in Sharepoint | Tagged: , | Leave a Comment »

    Customizing Search Core Result xslt in Sharepoint 2010

    Posted by ken zheng on August 26, 2011

    First, include your newly created managed property in a list of fetched columns  within your Search Core Results:

    image

    Second, open your Search Core Results XSL:

    image

     

    Search  <xsl:template name="ResultDetail"> and you can put you new column under “src-Metadata2 class”

    image

    Third, Copy the XSLT back to your result page.

    Fourth, A full crawler on your content source

    Posted in Sharepoint | Tagged: , , | Leave a Comment »

    Property doesn’t exist or is used in a manner inconsistent with schema settings.

    Posted by ken zheng on August 26, 2011

    If you added the column name in the Fetched Properties of the result page, you may get this error. In Fast Search, you need to add Managed Property to Property Management.

    image

    Posted in Fast Search, Sharepoint | Tagged: , , | 2 Comments »

    Search Scope for Content Source in Fast Search

    Posted by ken zheng on August 26, 2011

    TechNet has an article to create and view Search Scope, but I followed all the procedure still can’t get Item in the search scope.

    After hours search, I found you will need to create a content source in your Fast Search Query service as well.

    Below is the PowerShell I run to create the search scope

    a list of all available content sources
    
    
    
    $searchapp = Get-SPEnterpriseSearchServiceApplication "FASTQuery Service Application" 
    
    
    
    Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $searchapp
    
    
    
    
    
    $searchapp = Get-SPEnterpriseSearchServiceApplication "FASTQuery Service Application" 
    
    $scope = New-SPEnterpriseSearchQueryScope -Name "productsscope " -Description "product scope created in PowerShell" -SearchApplication $searchapp -DisplayInAdminUI $true 
    
    New-SPEnterpriseSearchQueryScopeRule -RuleType PropertyQuery -ManagedProperty ContentSource -PropertyValue "Product Master"-FilterBehavior Include -url http://simsearch.simapps -scope $scope -SearchApplication $searchapp
    
    
    				

    Posted in Fast Search, Sharepoint | Tagged: , , | Leave a Comment »

    External Content Type: An error occurred while retrieving data from a system. Administrators, see the server log for more information

    Posted by ken zheng on August 18, 2011

    I had this problem when setting up site column to look up external content type list. After a few trial, I found you need to tick “Allow unlimited length in document libraries”.

    image

    Posted in Sharepoint | Tagged: , , | 1 Comment »

    Update Metadata Field In Word Document

    Posted by ken zheng on August 15, 2011

    If you create a work template for a content type, you may find any updates on the content type may not reflect to the word template, e.g. new field is not shown on the Information Panel.

    The solution I found is to create a dummy new document library and apply the content type. Open the document, you will find the changes and then save to word template. Upload the template to your Content type.

    I also found “only 255 chars allowed” in multiple lines field. Evan I checked “Allow Unlimited Chars”. I wrote the code to update the site column (You may not need), created a dummy document library and then apply the content type;

     using (SPSite osite = new SPSite("http://chidev51:32921/SitePages/Home.aspx"))
    
                    {
    
                        using (SPWeb oweb = osite.OpenWeb())
    
                        {
    
                            //SPList myList = oweb.Lists["SGM Recipe Doc"];
    
    
    
                            string fieldname = "Overview"; //"Instruction"; //Ingredients
    
    
    
                            SPField myField = oweb.Fields[fieldname];
    
    
    
                            ((SPFieldMultiLineText)myField).UnlimitedLengthInDocumentLibrary = true;
    
    
    
                            myField.Update();
    
                            Console.WriteLine("Done; ");
    
                        }
    
                    }

    Posted in Sharepoint, vs2010 | Tagged: , , | Leave a Comment »

    User Profile Synchronization Service Won’t Start

    Posted by ken zheng on August 5, 2011

    Every time after the CU update in SharePoint 2011, User Profile Service runs funny. “User Profile Synchronization Service ” stopped in the serer.

    To resolve the issue, I found is to restart the SharePoint Timer Service (via Services) on the server running User Profile Service  and try starting UPS again from Central Admin. You will need to restart the server again.

    Hope that helps.

    Posted in Sharepoint | Tagged: | Leave a Comment »

    The Web application at XXX could not be found when using SharePoint Console

    Posted by ken zheng on August 3, 2011

    When using SharePoint 2010 Server OM code  on a Windows 2008 64 bit server, you get below exception :

    The Web application at http://servername:portnumber/sitename/ could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

    You are using a very simple code and the exception occurs at the very first line while opening new instance of an SPSite :

    using (SPSite osite = new SPSite("http://blrs2r11-1c/"))
            {
                using (SPWeb oweb = osite.OpenWeb())
                {
                   // Response.Write(oweb.Title);
                    Label1.Text = oweb.Title;
                }
            }
    The solution is in your visual studio, change the target platform to 64 bit.
    image

    Update: Or you may not have permission to run the code.

    Posted in Sharepoint, vs2010 | Tagged: , | 1 Comment »

     
    Follow

    Get every new post delivered to your Inbox.

    Join 28 other followers