Sharepoint Insight by Namwar Rizvi

Sharepoint Tips, Tricks and inside knowledge from real world experience by Namwar Rizvi

Posts Tagged ‘Sharepoint’

How to generate a valid SharePoint FileName

Posted by namwar on June 17, 2010


SharePoint imposes several restrictions for the filenames. To get the details of all these restrictions, please check this support article from Microsoft. I have created a utility function to convert a given string to a valid SharePoint filename. This function is valid for SharePoint 2003, 2007 and 2010. Here you go

public string ConvertToValidSharePointFileName(string originalFileName)
        {
            char[] InvalidFilenameCharacters = new[] {'\\', '/', ':', '*', '?', '"', '<', '>', '|', '#', '{', '}', '%', '~','&' };
            string[] InvalidFileNameStrings = new[] { ".files", "_files", 
                "-Dateien", "_fichiers", "_bestanden","_file", 
                "_archivos", "-filer", "_tiedostot", "_pliki", 
                "_soubory","_elemei", "_ficheiros", "_arquivos", 
                "_dosyalar", "_datoteke","_fitxers", "_failid", 
                "_fails", "_bylos", "_fajlovi", "_fitxategiak"};
            
            string validSharePointFileName = originalFileName;

            //Remove Invalid characters
            validSharePointFileName = validSharePointFileName.Remove(InvalidFilenameCharacters);
            
            //Remove consecutive periods(..)
            while (validSharePointFileName.Contains(".."))
            {
                validSharePointFileName = validSharePointFileName.Replace("..", ".");
            }

            //Remove reserved words from end
            foreach (string s in InvalidFileNameStrings)
            {
                if (validSharePointFileName.EndsWith(s))
                {
                    if (validSharePointFileName.Length > s.Length)
                    {
                        validSharePointFileName = validSharePointFileName.Substring(0, validSharePointFileName.Length - s.Length);
                    }
                }
            }

            //Remove period (.) at end
            if (validSharePointFileName.EndsWith("."))
            {
                validSharePointFileName = validSharePointFileName.Remove(validSharePointFileName.Length - 1, 1);
            }

            //Remove period (.) at end
            if (validSharePointFileName.StartsWith("."))
            {
                validSharePointFileName = validSharePointFileName.Remove(0, 1);
            }

            return validSharePointFileName;
        }

Posted in C#, Solutions, SP2010, Tips | Tagged: , , , , | Leave a Comment »

How to solve never ending “Sleeping for 10 seconds” upgrade message of SharePoint

Posted by namwar on June 13, 2010


While performing upgrade, sometime SharePoint got stuck and continously log message “Sleeping for 10 seconds…” in Upgrade.Log . To solve this issue, just perform following two steps

  1. End the task psconfig.exe,if it is running,  from task manager.
  2. From command prompt, execute the following command psconfig -cmd upgrade -inplace b2b -wait -force
  3. Wait to complete the upgrade. Once done, just browse your SharePoint site as usual, it will be back again:)

Posted in Architecture, Solutions, Troubleshooting | Tagged: , , | Leave a Comment »

How to find Microsoft.SharePoint.ApplicationPages.dll and some other assemblies

Posted by namwar on June 12, 2010


You may be wondering where to find Microsoft.SharePoint.ApplicationPages.dll , if you are creating a new SharePoint application page? But don’t worry, it resides in _app_bin folder of your SharePoint site’s virtual directory.

Assuming your IIS inetpub is at C then the exact path of Microsoft.SharePoint.ApplicationPages.dll is

C:\Inetpub\wwwroot\wss\VirtualDirectories\<Your Virtual Server >\_app_bin\Microsoft.SharePoint.ApplicationPages.dll

Here is the full list of assemblies at _app_bin folder:

  1. Microsoft.Office.DocumentManagement.Pages.dll
  2. Microsoft.Office.officialfileSoap.dll
  3. Microsoft.Office.Policy.Pages.dll
  4. Microsoft.Office.SlideLibrarySoap.dll
  5. Microsoft.Office.Workflow.Pages.dll
  6. Microsoft.Office.WorkflowSoap.dll
  7. Microsoft.SharePoint.ApplicationPages.dll
  8. STSSOAP.DLL

Posted in Information, Object Model, Tips, Troubleshooting | Tagged: , , , , | Leave a Comment »

How to create a general purpose Search Results ticker in SharePoint by jQuery

Posted by namwar on May 22, 2010


Business Problem

Display SharePoint search results as a scrolling ticker.

Solution:

SharePoint has two very powerful web parts Search Core Results WebPart and Content Editor WebPart . By combining these two web parts along with some jQuery and jCarousel Lite plug-in we can achieve desired results very quickly. The technique described here is very generic and can be used in CQWP and other web parts too.

What we are doing is quite simple. We use jCarousel plugin for jQuery to scroll the elements of HTML unordered list i.e. <ul>. To achieve this we need an HTML code similar to following

<div class="wrapper">
   <ul id="listticker">
       <li>Item 1</li>
       <li>Item 2</li>
       <li>Item 3</li>
   </ul>
 </div>

We generate this code by updating the XSL of Search Core Results Web part.

Step 1 : Setup required javascript libraries:

  • jQuery: No need to download, we will use it from Google CDN.
  • jCarousel Lite: Please download it from here and store it either under _layouts folder or in a document library at your sharepoint web.

Step 2 : Add Content Editor Web Part (CEWP):

Add CEWP on your target page. Edit the CEWP and paste following code by clicking on Source Editor:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

//Replace the value of src attribute with the path of your jcarousellite.js file
<script type="text/javascript" src="http://moss-server/SearchCenter/Resources/jcarousellite/jcarousellite.js"></script>

<script type="text/javascript">
$(function() {
	$(".wrapper").jCarouselLite({
		vertical: true,
		hoverPause:true,
		visible: 1,
		auto:3000,
		speed:1000
	});
});
</script>

Step 3 : Add Search Core Results Web Part :

Add Search Core Results web part. Configure the web part as you wish. For example, I used it to display all documents by using  Fixed Keyword Query functionality as follows:

  • Fixed Keyword Query = IsDocument:1
  • Cross-Web Part query ID = Query 2

Step 4 : Update XSL of Search Core Results Web Part :

Click XSL Editor and paste following XSL

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:param name="ResultsBy" />
<xsl:param name="ViewByUrl" />
<xsl:param name="ViewByValue" />
<xsl:param name="IsNoKeyword" />
<xsl:param name="IsFixedQuery" />
<xsl:param name="ShowActionLinks" />
<xsl:param name="MoreResultsText" />
<xsl:param name="MoreResultsLink" />
<xsl:param name="CollapsingStatusLink" />
<xsl:param name="CollapseDuplicatesText" />
<xsl:param name="AlertMeLink" />
<xsl:param name="AlertMeText" />
<xsl:param name="SrchRSSText" />
<xsl:param name="SrchRSSLink" />
<xsl:param name="ShowMessage" />
<xsl:param name="IsThisListScope" />
<xsl:param name="DisplayDiscoveredDefinition" select="True" />
<xsl:param name="NoFixedQuery" />
<xsl:param name="NoKeyword" />
<xsl:param name="NoResults" />
<xsl:param name="NoResults1" />
<xsl:param name="NoResults2" />
<xsl:param name="NoResults3" />
<xsl:param name="NoResults4" />
<xsl:param name="DefinitionIntro" />

<!-- When there is keywory to issue the search -->
<xsl:template name="dvt_1.noKeyword">
  <span class="srch-description">
  <xsl:choose>
  <xsl:when test="$IsFixedQuery">
      <xsl:value-of select="$NoFixedQuery" />
  </xsl:when>
   <xsl:otherwise>
      <xsl:value-of select="$NoKeyword" />
   </xsl:otherwise>
  </xsl:choose>
  </span>
</xsl:template>

<!-- When empty result set is returned from search -->
<xsl:template name="dvt_1.empty">
 <div class="srch-sort">
  <xsl:if test="$AlertMeLink and $ShowActionLinks">
    <span class="srch-alertme" > <a href ="{$AlertMeLink}" id="CSR_AM1" title="{$AlertMeText}"><img style="vertical-align: middle;" src="/_layouts/images/bell.gif" alt="" border="0"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><xsl:value-of select="$AlertMeText" /></a>
    </span>
  </xsl:if>

  <xsl:if test="string-length($SrchRSSLink) &gt; 0 and $ShowActionLinks">
   <xsl:if test="$AlertMeLink">
    |
   </xsl:if>
   <a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL"><img style="vertical-align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><xsl:value-of select="$SrchRSSText"/></a>
  </xsl:if>
 </div>
 <br/> <br/>

  <span class="srch-description" id="CSR_NO_RESULTS">
   <xsl:value-of select="$NoResults" />

    <ol>
    <li><xsl:value-of select="$NoResults1" /></li>
    <li><xsl:value-of select="$NoResults2" /></li>
    <li><xsl:value-of select="$NoResults3" /></li>
    <li><xsl:value-of select="$NoResults4" /></li>
    </ol>
  </span>
</xsl:template>

<!-- Main body template. Sets the Results view (Relevance or date) options -->
<xsl:template name="dvt_1.body">

  <div class="srch-results">
  <xsl:if test="$ShowActionLinks">
  <div class="srch-sort"> <xsl:value-of select="$ResultsBy" />
   <xsl:if test="$ViewByUrl">
     |
    <a href ="{$ViewByUrl}" id="CSR_RV" title="{$ViewByValue}">
     <xsl:value-of select="$ViewByValue" />
    </a>
   </xsl:if>
   <xsl:if test="$AlertMeLink">
     |
    <span class="srch-alertme" > <a href ="{$AlertMeLink}" id="CSR_AM2" title="{$AlertMeText}"><img style="vertical-align: middle;" src="/_layouts/images/bell.gif" alt="" border="0"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><xsl:value-of select="$AlertMeText" /></a>
    </span>
   </xsl:if>
   <xsl:if test="string-length($SrchRSSLink) &gt; 0">
     |
     <a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL"><img style="vertical-align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><xsl:value-of select="$SrchRSSText"/></a>
   </xsl:if>
  </div>
  <br /><br />
  </xsl:if>

	<div class="wrapper">
			<ul id="listticker">
				<xsl:apply-templates />
			</ul>

	</div>

  </div>

  <xsl:call-template name="DisplayMoreResultsAnchor" />

</xsl:template><!-- This template is called for each result -->
<xsl:template match="Result">
  <xsl:variable name="id" select="id"/>
  <xsl:variable name="url" select="url"/>
	<li>
  <span class="srch-Icon">
   <a href="{$url}" id="{concat('CSR_IMG_',$id)}" title="{$url}">
   <img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
   </a>
  </span>
  <span class="srch-Title">
   <a href="{$url}" id="{concat('CSR_',$id)}" title="{$url}">
    <xsl:choose>
     <xsl:when test="hithighlightedproperties/HHTitle[. != '']">
         <xsl:call-template name="HitHighlighting">
          <xsl:with-param name="hh" select="hithighlightedproperties/HHTitle" />
         </xsl:call-template>
     </xsl:when>
     <xsl:otherwise><xsl:value-of select="title"/></xsl:otherwise>
    </xsl:choose>
   </a>
    <br/>
   </span>

   <xsl:choose>
     <xsl:when test="$IsThisListScope = 'True' and contentclass[. = 'STS_ListItem_PictureLibrary'] and picturethumbnailurl[. != '']">
       <div style="padding-top: 2px; padding-bottom: 2px;">
        <a href="{$url}" id="{concat('CSR_P',$id)}" title="{title}">
          <img src="{picturethumbnailurl}" alt="" />
        </a>
       </div>
     </xsl:when>
   </xsl:choose>
   <div class="srch-Description">
    <xsl:choose>
    <xsl:when test="hithighlightedsummary[. != '']">
       <xsl:call-template name="HitHighlighting">
          <xsl:with-param name="hh" select="hithighlightedsummary" />
       </xsl:call-template>
    </xsl:when>
     <xsl:when test="description[. != '']">
        <xsl:value-of select="description"/>
     </xsl:when>
    </xsl:choose>
    </div >
    <p class="srch-Metadata">

    <span class="srch-URL">
     <a href="{$url}" id="{concat('CSR_U_',$id)}" title="{$url}" dir="ltr">
      <xsl:choose>
        <xsl:when test="hithighlightedproperties/HHUrl[. != '']">
           <xsl:call-template name="HitHighlighting">
              <xsl:with-param name="hh" select="hithighlightedproperties/HHUrl" />
           </xsl:call-template>
        </xsl:when>
       <xsl:otherwise><xsl:value-of select="url"/></xsl:otherwise>
      </xsl:choose>
     </a>
    </span>
     <xsl:call-template name="DisplaySize">
      <xsl:with-param name="size" select="size" />
     </xsl:call-template>
     <xsl:call-template name="DisplayString">
      <xsl:with-param name="str" select="author" />
     </xsl:call-template>
     <xsl:call-template name="DisplayString">
      <xsl:with-param name="str" select="write" />
     </xsl:call-template>
     <xsl:call-template name="DisplayCollapsingStatusLink">
        <xsl:with-param name="status" select="collapsingstatus"/>
        <xsl:with-param name="urlEncoded" select="urlEncoded"/>
        <xsl:with-param name="id" select="concat('CSR_CS_',$id)"/>
     </xsl:call-template>
    </p>
	</li>
</xsl:template>

<xsl:template name="HitHighlighting">
 <xsl:param name="hh" />
 <xsl:apply-templates select="$hh"/>
</xsl:template>

<xsl:template match="ddd">
  …
</xsl:template>
<xsl:template match="c0">
    <b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c1">
    <b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c2">
    <b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c3">
    <b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c4">
    <b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c5">
    <b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c6">
    <b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c7">
    <b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c8">
    <b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c9">
    <b><xsl:value-of select="."/></b>
</xsl:template>

<!-- The size attribute for each result is prepared here -->
<xsl:template name="DisplaySize">
  <xsl:param name="size" />
  <xsl:if test='string-length($size) &gt; 0'>
   <xsl:if test="number($size) &gt; 0">
   -
    <xsl:choose>
     <xsl:when test="round($size div 1024) &lt; 1"><xsl:value-of select="$size" /> Bytes</xsl:when>
     <xsl:when test="round($size div (1024 *1024)) &lt; 1"><xsl:value-of select="round($size div 1024)" />KB</xsl:when>
     <xsl:otherwise><xsl:value-of select="round($size div (1024 * 1024))"/>MB</xsl:otherwise>
    </xsl:choose>
   </xsl:if>
  </xsl:if>
</xsl:template>

<!-- A generic template to display string with non 0 string length (used for author and lastmodified time -->
<xsl:template name="DisplayString">
  <xsl:param name="str" />
  <xsl:if test='string-length($str) &gt; 0'>
   -
   <xsl:value-of select="$str" />
  </xsl:if>
</xsl:template>

<!-- document collapsing link setup -->
<xsl:template name="DisplayCollapsingStatusLink">
    <xsl:param name="status"/>
    <xsl:param name="urlEncoded"/>
    <xsl:param name="id"/>
    <xsl:if test="$CollapsingStatusLink">
      <xsl:choose>
          <xsl:when test="$status=1">
              <br/>
              <xsl:variable name="CollapsingStatusHref" select="concat(substring-before($CollapsingStatusLink, '$$COLLAPSE_PARAM$$'), 'duplicates:&quot;', $urlEncoded, '&quot;', substring-after($CollapsingStatusLink, '$$COLLAPSE_PARAM$$'))"/>
              <span class="srch-dup">
              [<a href="{$CollapsingStatusHref}" id="$id" title="{$CollapseDuplicatesText}">
              <xsl:value-of select="$CollapseDuplicatesText"/>
              </a>]
              </span>
          </xsl:when>
      </xsl:choose>
    </xsl:if>
</xsl:template><!-- The "view more results" for fixed query -->
<xsl:template name="DisplayMoreResultsAnchor">
  <xsl:if test="$MoreResultsLink">
   <a href="{$MoreResultsLink}" id="CSR_MRL">
    <xsl:value-of select="$MoreResultsText"/>
    </a>
   </xsl:if>
</xsl:template>

<xsl:template match="All_Results/DiscoveredDefinitions">
  <xsl:variable name="FoundIn" select="DDFoundIn" />
  <xsl:variable name="DDSearchTerm" select="DDSearchTerm" />
  <xsl:if test="$DisplayDiscoveredDefinition = 'True' and string-length($DDSearchTerm) &gt; 0">
    <script language="javascript">
      function ToggleDefinitionSelection()
      {
        var selection = document.getElementById("definitionSelection");
        if (selection.style.display == "none")
        {
          selection.style.display = "inline";
        }
        else
        {
          selection.style.display = "none";
        }
      }
    </script>
    <div>
      <a href="#" onclick="ToggleDefinitionSelection(); return false;">
        <xsl:value-of select="$DefinitionIntro" /><b><xsl:value-of select="$DDSearchTerm"/></b></a>
      <div id="definitionSelection" class="srch-Description" style="display:none;">
        <xsl:for-each select="DDefinitions/DDefinition">
          <br/>
          <xsl:variable name="DDUrl" select="DDUrl" />
          <xsl:value-of select="DDStart"/>
          <b>
            <xsl:value-of select="DDBold"/>
          </b>
          <xsl:value-of select="DDEnd"/>
          <br/>
          <xsl:value-of select="$FoundIn"/>
          <a href="{$DDUrl}">
          <xsl:value-of select="DDTitle"/>
          </a>
        </xsl:for-each>
      </div>
    </div>
  </xsl:if>
</xsl:template>

<!-- XSL transformation starts here -->
<xsl:template match="/">
  <xsl:if test="$AlertMeLink">
   <input type="hidden" name="P_Query" />
   <input type="hidden" name="P_LastNotificationTime" />
  </xsl:if>
  <xsl:choose>
   <xsl:when test="$IsNoKeyword = 'True'" >
    <xsl:call-template name="dvt_1.noKeyword" />
   </xsl:when>
   <xsl:when test="$ShowMessage = 'True'">
     <xsl:call-template name="dvt_1.empty" />
   </xsl:when>
   <xsl:otherwise>
    <xsl:call-template name="dvt_1.body"/>
   </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<!-- End of Stylesheet -->
</xsl:stylesheet>

Step 5 : Enjoy! :
Click OK and exit from edit mode. Your ticker is ready, Enjoy.

Posted in Information, JavaScript, jQuery, Search, Solutions | Tagged: , , , , , , , , , | Leave a Comment »

Access Denied for SharePoint Site Owner

Posted by namwar on February 24, 2010


There are times when SharePoint can even deny the Site Owner to access his/her site. There are numerous reasons behind this issue but I just want to give you the solution. So here it is:

Step 1:

Run following stsadm command after replacing place holders, mentioned in <>, by actual values:

stsadm -o siteowner -url <YourSiteUrl> -ownerlogin <Domain\AnyValidUser>

 Step 2:

Run following stsadm command after replacing place holders, mentioned in <>, by actual values:

stsadm -o siteowner -url <YourSiteUrl> -ownerlogin <Domain\SiteOwnerLogin>

Thats it. Now access the site by Site Owner user and you will be allowed.

Posted in Solutions, Tips, Troubleshooting | Tagged: , , | Leave a Comment »

How to debug Email Event Receiver

Posted by namwar on January 14, 2010


Normally when you debug an event receiver in SharePoint, you attach your debugger with w3wp.exe process. But email received event is not processed by this process.

Instead, you need to attach your debugger with OWSTIMER.exe process. This is the “Windows SharePoint Services Timer” service.

If this process is not listed in your processes list then click on “Show processes from all users” to display all processes similar to following:

OWSTimer image

Posted in Debugging, Tips | Tagged: , , | Leave a Comment »

How to dynamically construct the SharePoint site relative url in JavaScript

Posted by namwar on January 1, 2010


There are times when you want to dynamically construct a SharePoint site relative Urls e.g. if you are calling a SharePoint webservice from JQuery etc. then you will need to call it in context of your required site.

Most people try to slice and dice the URL of the current page and try to find the SharePoint site from it. This is not a very clean way of doing it.

The more easy and clean way is the way SharePoint itself does which is using the JavaScript variable called L_Menu_BaseUrl

This variable holds the relative url of current site.

So for example, if you want to call Lists.asmx for

http://yourintranet/sites/Finance/ then

L_Menu_BaseUrl + ‘/_vti_bin/Lists.asmx’ will give you the required url for web service.

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

Reverse Engineer the Schema of any List in SharePoint

Posted by namwar on December 26, 2009


If you have ever designed a custom list then you may already felt the pain of creating the schema of it and writing the whole CAML. Sometimes, we just need to enhance an already existing list by creating our own custom list for which we want to copy the existing schema and do the necessary changes.

You can retrieve the schema of any list by using the owssvr.dll call from your browser. Following is the syntax

http://<YourServer>/_vti_bin/owssvr.dll?Cmd=ExportList&amp;List=<YourListGuid>&#8221;

By replacing the Server and List GUID in above url will return you the XML Schema of the list.

To make thing easier, I have created a Feature to add a custom action in Settings menu called “Display Schema“, Click it and you will get the schema of the list.

Steps to create the feature:

1. Create a new folder called “DisplaySchema” in Features folder.

2. Create Feature.xml file and paste the following code

<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="{A66E6CBA-8EA1-4c28-B233-52B3D7FF352B}"
    Title="Display List Schema"
    Description="This feature adds a custom menu item in Settings menu to display List Schema"
    Version="1.0.0.0"
    Scope="Site"
    xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="Elements.xml" />
  </ElementManifests>
</Feature>

3. Create Elements.xml file and paste the following code

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- List Toolbar Settings Menu Dropdown -->
  <CustomAction Id="DisplayListSchema"
    RegistrationType="List"
    GroupId="SettingsMenu"
    Location="Microsoft.SharePoint.StandardMenu"
    Sequence="1000"
    Title="Display Schema"
	Description="Displays schema of the list">
    <UrlAction Url="~site/_vti_bin/owssvr.dll?Cmd=ExportList&amp;List={ListId}"/>
  </CustomAction>
</Elements>

4. Install the feature by using stsadm command line tool.
5. Activate it.
6. Navigate to any list, Document Library, Tasks list etc. and click Settings, and then click Display Schema.
You will get the schema of that list. Copy it and enjoy!

Posted in Customization, Feature, Solutions, Tips, Tools | Tagged: , , , | 2 Comments »

Displaying only Year in SharePoint Calculated Column

Posted by namwar on November 26, 2009


I wanted to display just the year of a DateTime column of SharePoint. I created a calculated column and set the formula to Year([MyDateTimeColumn]). The result I got was 2,009 ; 2,008 etc. which offcourse incorrect for year. After searching through internet, I found a good article solved my problem.

The correct formula is TEXT(YEAR([MyDateTimeColumn]),”000″)


Posted in Architecture, Customization, Solutions, Tips | Tagged: , , , | Leave a Comment »

Custom Edit Form for SharePoint Lists

Posted by namwar on October 21, 2009


If you want to set a custom edit form to your Sharepoint List then please make sure you follow these Golden Rules as correctly suggested by Hugo in a SharePoint news group.

  1. NEVER delete or rename the default pages…
    when you want to create a new EditForm.aspx it’s best to copy it to
    another file and then edit the original one (without renaming it and
    without reassigning the supporting files)…
  2. DON’T ever delete the webparts that exist.
    It’s better to hide them and create new ones “side-by-side”.

These rules are real time savers and I will highly encourage every reader to follow them.

Posted in Customization, Errors, Tips | Tagged: , , , | 1 Comment »