1. Open site with SharePoint Designer and Insert a DataView WebPart(DVWP) on a page including your multiline field.
2. Switch to codeview and find the line that reference the field. (need to replace - <xsl:value-of select="@Comments" disable-output-escaping="yes" />
3. Replace with:
<SharePoint:AppendOnlyHistory runat="server" FieldName="Comments" ControlMode="Display" ItemId="{@ID}"/>
You will see the all the comments with author and dates.
Thursday, March 1, 2012
To get all the versions for Multiline text field
allComments = "";
foreach (SPListItemVersion versionListItem in item.Versions)
{
if (versionListItem["Comments"] != null){
allComments += versionListItem["Comments"].ToString();
}
}
Thursday, November 17, 2011
How to save a site as template using PowerShell
Here is Powershell script to save a site as template.
$SiteUrl = "http://Sharepoint2010/site"
$Web=Get-SPWeb $SiteUrl
$Web.SaveAsTemplate("Template Name","Template Title","Template Description",1)
$SiteUrl = "http://Sharepoint2010/site"
$Web=Get-SPWeb $SiteUrl
$Web.SaveAsTemplate("Template Name","Template Title","Template Description",1)
The last parameter of SaveAsTemplate() can be 0 or 1. 1 if you want to save the site with data else 0.
Make sure you open the SharePoint Management Shell as Administrator.Error - "MOSS MA not found”
Yesterday I got his error "MOSS MA not found” while creating the connector for User Profile synchronization in SharePoint 2010.
To fix that -
I restarted the Forefront Identity Manager Service and the Forefront Identity Manager Synchronization Service.To find those services
Run > Services.msc > Forefront Services > right click and select restart.
If services do not start, You may need to enter service account/password on Logon Tab of service properties screen. Hope this help!
How to Hide search box
There are ways to hide the search box.
1. If you can edit master page, just set ‘visible’ property of Serachbox control to false. (DONOT Edit OOTB SharePoint master page and may cause issues in other areas.)
#s4-searcharea { display:none; }
</style>
1. If you can edit master page, just set ‘visible’ property of Serachbox control to false. (DONOT Edit OOTB SharePoint master page and may cause issues in other areas.)
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" Version="4" Visible="false"/>
2. You can use CSS to hide the Searchbox by setting the display property to none. Add this to custom css file.
#s4-searcharea { display:none; } If you want to hide search box in a specific page then you can use Content Editor webpart and place CSS code like this.
<style>#s4-searcharea { display:none; }
</style>
How to Hide a List using PowerShell
Last week i had a requirement to hide a list from user view. To achieve that, I used PowerShell to hide a list in SharePoint 2010 by setting hidden property of SPList Object to $true.
Here is the script -
#--- Update these variables -----
$SiteUrl = "http://Sharepoint2010/site"
$ListURL = "http://Sharepoint2010/site/Lists/ListToHide"
#-------------------------------------
$Web = Get-SPWeb $SiteUrl
$List = $spWeb.GetList($ListURL)
$List.Hidden = $true
$List.Update()
Here is the script -
#--- Update these variables -----
$SiteUrl = "http://Sharepoint2010/site"
$ListURL = "http://Sharepoint2010/site/Lists/ListToHide"
#-------------------------------------
$Web = Get-SPWeb $SiteUrl
$List = $spWeb.GetList($ListURL)
$List.Hidden = $true
$List.Update()
Subscribe to:
Posts (Atom)