Just type the following URL in the browser. It will show the detailed Site Defination Project schema from ONET.xml.
<SiteUrl>/_vti_bin/owssvr.dll?Cmd=getprojschema
About Me
Blog Sections
- Asp.Net and Web technology (16)
- Fun - Songs and lyrics (3)
- Knowledge Arena (3)
- MOSS2007 (1)
- Sharepoint (53)
Knowledge-Ideas-Solutions-Fixes
Monday, January 11, 2010
Wednesday, December 9, 2009
Set Item level permission in Sharepoint Document Library
In Documnet library, we can not set item level permission by using Sharepoint Document Library Settings (unlike sharepoint List Settings). There is a very simple code snippet which does the same for us.
Code snippet
using (SPSite spSiteObje = new SPSite("http://SiteColName/Subsite"))
{
using (SPWeb spObjWeb = site.OpenWeb())
{
SPList spObjDocLib = web.Lists["MyDocLib"];
spObjDocLib.ReadSecurity = 2;
spObjDocLib.WriteSecurity = 2;
spObjDocLib.Update();
}
}
Code snippet
using (SPSite spSiteObje = new SPSite("http://SiteColName/Subsite"))
{
using (SPWeb spObjWeb = site.OpenWeb())
{
SPList spObjDocLib = web.Lists["MyDocLib"];
spObjDocLib.ReadSecurity = 2;
spObjDocLib.WriteSecurity = 2;
spObjDocLib.Update();
}
}
Use ListViewWebPart to display listdata from different than current sharepoint site.
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
namespace TestDashboard
{
[Guid("b732479d-6bcd-4dd9-97de-85f11bsdc5cb")]
public class TestDashboard : System.Web.UI.WebControls.WebParts.WebPart
{
public TestDashboard()
{
}
protected override void CreateChildControls()
{
base.CreateChildControls();
ListViewWebPart wp = new ListViewWebPart();
SPSite objSpSite = null;
using (objSpSite = new SPSite("http://SiteColName/SiteName/"))
{
objSpSite = new SPSite("http://SiteColName/SiteName/", objSpSite.SystemAccount.UserToken);
using (SPWeb spweb = objSpSite.OpenWeb())
{
SPList splist = spweb.Lists["ListName"];
wp.ListName = splist.ID.ToString("B").ToUpper();
wp.ViewGuid = splist.Views["All Items"].ID.ToString("B").ToUpper();
wp.ViewType = ViewType.Html;
wp.WebId = spweb.ID;
wp.SuppressWebPartChrome = true;
wp.GetDesignTimeHtml();
this.Controls.Add(wp);
}
}
}
protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
EnsureChildControls();
}
}
}
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
namespace TestDashboard
{
[Guid("b732479d-6bcd-4dd9-97de-85f11bsdc5cb")]
public class TestDashboard : System.Web.UI.WebControls.WebParts.WebPart
{
public TestDashboard()
{
}
protected override void CreateChildControls()
{
base.CreateChildControls();
ListViewWebPart wp = new ListViewWebPart();
SPSite objSpSite = null;
using (objSpSite = new SPSite("http://SiteColName/SiteName/"))
{
objSpSite = new SPSite("http://SiteColName/SiteName/", objSpSite.SystemAccount.UserToken);
using (SPWeb spweb = objSpSite.OpenWeb())
{
SPList splist = spweb.Lists["ListName"];
wp.ListName = splist.ID.ToString("B").ToUpper();
wp.ViewGuid = splist.Views["All Items"].ID.ToString("B").ToUpper();
wp.ViewType = ViewType.Html;
wp.WebId = spweb.ID;
wp.SuppressWebPartChrome = true;
wp.GetDesignTimeHtml();
this.Controls.Add(wp);
}
}
}
protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
EnsureChildControls();
}
}
}
Wednesday, December 2, 2009
Customize EditForm.aspx, AllItems.aspx or any forms.
1. Goto Sharepoint designer.
2. Open desired site and then list in folder view.
3. Copy EditForm.aspx and paste it
4. Rename the newly copied EditForm.aspx ( MyEditForm.aspx)
5. In new MyEditForm.aspx go to code view.
6. Search for ListFormWebPart. (WebPartPages:ListFormWebPart)
7. Go to the properties of ListFormWebPart (Webpart properties)
8. Check the hidden check box under layouts section. (Layouts/Hidden)
9. THen,
10. Go to Insert menu.
11. Select Sharepoint Controls.
12. Add Custom List Form.
13. It will expose the whole webpart in a form of text boxes,lables and all HTML controls.
You can play with them by hide/show or whatever you want to achieve. Nice enough???
Note: By doing so, you will also able to add column values for Folder also. I mean, generally you can not add properties of Folder, unlike you can do for a list item or a Document. But this process will enable you to add properties of folder.
2. Open desired site and then list in folder view.
3. Copy EditForm.aspx and paste it
4. Rename the newly copied EditForm.aspx ( MyEditForm.aspx)
5. In new MyEditForm.aspx go to code view.
6. Search for ListFormWebPart. (WebPartPages:ListFormWebPart)
7. Go to the properties of ListFormWebPart (Webpart properties)
8. Check the hidden check box under layouts section. (Layouts/Hidden)
9. THen,
10. Go to Insert menu.
11. Select Sharepoint Controls.
12. Add Custom List Form.
13. It will expose the whole webpart in a form of text boxes,lables and all HTML controls.
You can play with them by hide/show or whatever you want to achieve. Nice enough???
Note: By doing so, you will also able to add column values for Folder also. I mean, generally you can not add properties of Folder, unlike you can do for a list item or a Document. But this process will enable you to add properties of folder.
Monday, November 30, 2009
Accept mail and create an item in Document Library
This feature allow us to add a new item in a document library by sending an email to the specified email address.
Go to Document Library Settting -> Incoming mail setting(Under communication tab)
Really good one!!
Help Link :
http://blogs.msdn.com/selvagan/archive/2008/01/26/incoming-email-configuration-moss.aspx
Go to Document Library Settting -> Incoming mail setting(Under communication tab)
Really good one!!
Help Link :
http://blogs.msdn.com/selvagan/archive/2008/01/26/incoming-email-configuration-moss.aspx
Application page with UnsecuredLayoutsPageBase
Sharepoint site with secure socket layer (Https) requires to be inherited with "UnsecuredLayoutsPageBase"
See the code sample given below:
public class Class1 :UnsecuredLayoutsPageBase
{
protected Label lblSiteTitle;
protected Label lblSiteID;
protected DropDownList DropDownList1;
protected override void OnLoad(EventArgs e)
{
SPWeb site = this.Web;
lblSiteTitle.Text = site.Title;
lblSiteID.Text = site.ID.ToString().ToUpper();
}
protected void Button_Click(object sender, EventArgs e)
{
Response.Write(DropDownList1.SelectedValue);
}
}
See the code sample given below:
public class Class1 :UnsecuredLayoutsPageBase
{
protected Label lblSiteTitle;
protected Label lblSiteID;
protected DropDownList DropDownList1;
protected override void OnLoad(EventArgs e)
{
SPWeb site = this.Web;
lblSiteTitle.Text = site.Title;
lblSiteID.Text = site.ID.ToString().ToUpper();
}
protected void Button_Click(object sender, EventArgs e)
{
Response.Write(DropDownList1.SelectedValue);
}
}
Get List Data using SPView
Check code snippet:
SPWeb spWebTest = siteCollection.RootWeb.Webs["Test"];
SPList splTestDetails = spWebTest.Lists["TestTeam"];
//Get the Test person names from Test site
SPView spvTestPerson = splTestDetails.Views["TestPerson"];
DataTable dtTestPerson = splTestDetails.GetItems(spvTestPerson).GetDataTable();
SPWeb spWebTest = siteCollection.RootWeb.Webs["Test"];
SPList splTestDetails = spWebTest.Lists["TestTeam"];
//Get the Test person names from Test site
SPView spvTestPerson = splTestDetails.Views["TestPerson"];
DataTable dtTestPerson = splTestDetails.GetItems(spvTestPerson).GetDataTable();
SpDisposeChecker tool - check memory leak in sharepoint
http://code.msdn.microsoft.com/SPDisposeCheck
Another good one for .Net : http://msdn.microsoft.com/en-us/library/ee658248.aspx
Thursday, November 19, 2009
Few very useful paths for sharepoint professionals
- 12 hive
- Assembly
- WSS for Web.config changes
- <%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,PublicKeyToken=71E9BCE111E9429C" % >
Friday, November 13, 2009
Flash in Sharepoint
Use content editor webpart.
Use following code for source of CEWP
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="worldtime" align="middle">
<param name="allowScriptAccess" value="servernamesharepoint" />
<param name="movie" value="http://servernamesharepoint/Test/TestDoclib/flashslide.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="http://servernamesharepoint/Test/TestDoclib/flashslide.swf" quality="high" bgcolor="#ffffff" name="worldtime" align="middle" allowScriptAccess="servernamesharepoint" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
Use following code for source of CEWP
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="worldtime" align="middle">
<param name="allowScriptAccess" value="servernamesharepoint" />
<param name="movie" value="http://servernamesharepoint/Test/TestDoclib/flashslide.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="http://servernamesharepoint/Test/TestDoclib/flashslide.swf" quality="high" bgcolor="#ffffff" name="worldtime" align="middle" allowScriptAccess="servernamesharepoint" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
Friday, November 6, 2009
Blogs of Friends
http://vinodvbhoite.blogspot.com
http://avinashkt.blogspot.com/
http://hiddensharepointfeatures.blogspot.com/
http://avinashkt.blogspot.com/
http://hiddensharepointfeatures.blogspot.com/
Saturday, October 31, 2009
Windows 2008 Server - Deploy Dll in Gac
1. Go to start --> Command Prompt as Administrator --> "explorer %windir%\assembly"
2. Open second command prompt. Go to start --> Command Prompt as Administrator --> "
explorer [path to directory where the dll is located]"
3. Drag drop the dll from the source directory to the GAC. Thats done.
2. Open second command prompt. Go to start --> Command Prompt as Administrator --> "
explorer [path to directory where the dll is located]"
3. Drag drop the dll from the source directory to the GAC. Thats done.
Thursday, October 29, 2009
Custom activity with full code for creating folder in list/Library with action file code
Code:
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using Microsoft.SharePoint;
namespace CreateFolder
{
public partial class Activity1 : Activity
{
public static DependencyProperty FolderNameProperty
= DependencyProperty.Register(
"FolderName", typeof(string), typeof(Activity1));
[DescriptionAttribute("FolderName")]
[CategoryAttribute("FolderName Category")]
[BrowsableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
public string FolderName
{
get
{
return ((string)(base.GetValue(Activity1.FolderNameProperty)));
}
set
{
base.SetValue(Activity1.FolderNameProperty, value);
}
}
public static DependencyProperty BaseUrlProperty
= DependencyProperty.Register("BaseUrl", typeof(string), typeof(Activity1));
[DescriptionAttribute("BaseUrl")]
[CategoryAttribute("BaseUrl Category")]
[BrowsableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
public string BaseUrl
{
get
{
return ((string)(base.GetValue(Activity1.BaseUrlProperty)));
}
set
{
base.SetValue(Activity1.BaseUrlProperty, value);
}
}
public static DependencyProperty ListNameProperty
= DependencyProperty.Register("ListName", typeof(string), typeof(Activity1));
[DescriptionAttribute("ListName")]
[CategoryAttribute("ListName Category")]
[BrowsableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
public string ListName
{
get
{
return ((string)(base.GetValue(Activity1.ListNameProperty)));
}
set
{
base.SetValue(Activity1.ListNameProperty, value);
}
}
public static DependencyProperty InvokeEvent
= DependencyProperty.Register("Invoke", typeof(EventHandler), typeof(Activity1));
[DescriptionAttribute("Invoke")]
[CategoryAttribute("Invoke Category")]
[BrowsableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
public event EventHandler Invoke
{
add
{
base.AddHandler(Activity1.InvokeEvent, value);
}
remove
{
base.RemoveHandler(Activity1.InvokeEvent, value);
}
}
public Activity1()
{
InitializeComponent();
}
protected override ActivityExecutionStatus
Execute(ActivityExecutionContext executionContext)
{
// Raise Invoke Event to execute custom code in the workflow.
this.RaiseEvent(Activity1.InvokeEvent,
this, EventArgs.Empty);
string strIndrajeet = FolderName;
string strBaseUrl = BaseUrl;
string strDocLibName = ListName;
SPSite spsite = new SPSite(strBaseUrl);
spsite = new SPSite(strBaseUrl, spsite.SystemAccount.UserToken);
using (SPWeb spweb = spsite.OpenWeb())
{
spsite.AllowUnsafeUpdates = true;
spweb.AllowUnsafeUpdates = true;
SPFolderCollection folders = spweb.GetFolder(strBaseUrl + "/" + strDocLibName).SubFolders;
bool boolFolderNotCreated = true;
if (!spweb.GetFolder(strBaseUrl + "/" + strDocLibName + "/" + strIndrajeet).Exists)
{
folders.Add(strIndrajeet);
boolFolderNotCreated = false;
spweb.Update();
}
int count = 1;
while (boolFolderNotCreated)
{
string folderName = strIndrajeet + "_" + Convert.ToString(count);
SPFolder spfTemp = spweb.GetFolder(strBaseUrl + "/" + strDocLibName + "/" + folderName);
if (!spfTemp.Exists)
{
folders.Add(folderName);
boolFolderNotCreated = false;
spweb.Update();
}
else
{
count++;
boolFolderNotCreated = true;
}
}
}
// Indicate that the activity has completed.
return ActivityExecutionStatus.Closed;
}
}
}
<strong>.Aciton file entry (under C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\1033\Workflow)</strong>
<blockquote></blockquote>""""
<workflowinfo>
<actions parallel="and" sequential="then">
<action category="List Actions" appliesto="all" assembly="CreateFolder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=effbcf4c7d0dab8e" classname="CreateFolder.Activity1" name="Create Folder">
<ruledesigner sentence="Create Folder in List %2 with folder name %1 under site %3">
<fieldbind id="1" designertype="TextArea" field="FolderName">
<fieldbind id="2" designertype="TextArea" field="ListName">
<fieldbind id="3" designertype="TextArea" field="BaseUrl">
</ruledesigner>
<parameters>
<parameter name="FolderName" direction="In" type="System.String, mscorlib">
<parameter name="ListName" direction="In" type="System.String, mscorlib">
<parameter name="BaseUrl" direction="In" type="System.String, mscorlib">
</parameters>
</action>
</actions>
</workflowinfo>
<strong>Web.Config Entry</strong>
<authorizedtype assembly="CreateFolder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=effbcf4c7d0dab8e" authorized="True" typename="*" namespace="">
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using Microsoft.SharePoint;
namespace CreateFolder
{
public partial class Activity1 : Activity
{
public static DependencyProperty FolderNameProperty
= DependencyProperty.Register(
"FolderName", typeof(string), typeof(Activity1));
[DescriptionAttribute("FolderName")]
[CategoryAttribute("FolderName Category")]
[BrowsableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
public string FolderName
{
get
{
return ((string)(base.GetValue(Activity1.FolderNameProperty)));
}
set
{
base.SetValue(Activity1.FolderNameProperty, value);
}
}
public static DependencyProperty BaseUrlProperty
= DependencyProperty.Register("BaseUrl", typeof(string), typeof(Activity1));
[DescriptionAttribute("BaseUrl")]
[CategoryAttribute("BaseUrl Category")]
[BrowsableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
public string BaseUrl
{
get
{
return ((string)(base.GetValue(Activity1.BaseUrlProperty)));
}
set
{
base.SetValue(Activity1.BaseUrlProperty, value);
}
}
public static DependencyProperty ListNameProperty
= DependencyProperty.Register("ListName", typeof(string), typeof(Activity1));
[DescriptionAttribute("ListName")]
[CategoryAttribute("ListName Category")]
[BrowsableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
public string ListName
{
get
{
return ((string)(base.GetValue(Activity1.ListNameProperty)));
}
set
{
base.SetValue(Activity1.ListNameProperty, value);
}
}
public static DependencyProperty InvokeEvent
= DependencyProperty.Register("Invoke", typeof(EventHandler), typeof(Activity1));
[DescriptionAttribute("Invoke")]
[CategoryAttribute("Invoke Category")]
[BrowsableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
public event EventHandler Invoke
{
add
{
base.AddHandler(Activity1.InvokeEvent, value);
}
remove
{
base.RemoveHandler(Activity1.InvokeEvent, value);
}
}
public Activity1()
{
InitializeComponent();
}
protected override ActivityExecutionStatus
Execute(ActivityExecutionContext executionContext)
{
// Raise Invoke Event to execute custom code in the workflow.
this.RaiseEvent(Activity1.InvokeEvent,
this, EventArgs.Empty);
string strIndrajeet = FolderName;
string strBaseUrl = BaseUrl;
string strDocLibName = ListName;
SPSite spsite = new SPSite(strBaseUrl);
spsite = new SPSite(strBaseUrl, spsite.SystemAccount.UserToken);
using (SPWeb spweb = spsite.OpenWeb())
{
spsite.AllowUnsafeUpdates = true;
spweb.AllowUnsafeUpdates = true;
SPFolderCollection folders = spweb.GetFolder(strBaseUrl + "/" + strDocLibName).SubFolders;
bool boolFolderNotCreated = true;
if (!spweb.GetFolder(strBaseUrl + "/" + strDocLibName + "/" + strIndrajeet).Exists)
{
folders.Add(strIndrajeet);
boolFolderNotCreated = false;
spweb.Update();
}
int count = 1;
while (boolFolderNotCreated)
{
string folderName = strIndrajeet + "_" + Convert.ToString(count);
SPFolder spfTemp = spweb.GetFolder(strBaseUrl + "/" + strDocLibName + "/" + folderName);
if (!spfTemp.Exists)
{
folders.Add(folderName);
boolFolderNotCreated = false;
spweb.Update();
}
else
{
count++;
boolFolderNotCreated = true;
}
}
}
// Indicate that the activity has completed.
return ActivityExecutionStatus.Closed;
}
}
}
<strong>.Aciton file entry (under C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\1033\Workflow)</strong>
<blockquote></blockquote>""""
<workflowinfo>
<actions parallel="and" sequential="then">
<action category="List Actions" appliesto="all" assembly="CreateFolder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=effbcf4c7d0dab8e" classname="CreateFolder.Activity1" name="Create Folder">
<ruledesigner sentence="Create Folder in List %2 with folder name %1 under site %3">
<fieldbind id="1" designertype="TextArea" field="FolderName">
<fieldbind id="2" designertype="TextArea" field="ListName">
<fieldbind id="3" designertype="TextArea" field="BaseUrl">
</ruledesigner>
<parameters>
<parameter name="FolderName" direction="In" type="System.String, mscorlib">
<parameter name="ListName" direction="In" type="System.String, mscorlib">
<parameter name="BaseUrl" direction="In" type="System.String, mscorlib">
</parameters>
</action>
</actions>
</workflowinfo>
<strong>Web.Config Entry</strong>
<authorizedtype assembly="CreateFolder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=effbcf4c7d0dab8e" authorized="True" typename="*" namespace="">
Wednesday, October 28, 2009
Tuesday, October 27, 2009
Tuesday, October 13, 2009
A very good link for image search in Sharepoint
Labels:
Sharepoint
http://blogs.catapultsystems.com/matthew/archive/2008/08/28/sharepoint-image-search-part-1.aspx
How to crawl the content in sharepoint search
Labels:
Sharepoint
1. Go to Central Admin--> Shared Services--> Search Settings --> Content sources and crawl schedules
2. Shared Services Administration: SharedServices1 > Search Administration > Content Sources
3. Local Office SharePoint Server sites
4. Start Full Crawl
2. Shared Services Administration: SharedServices1 > Search Administration > Content Sources
3. Local Office SharePoint Server sites
4. Start Full Crawl
Thursday, October 1, 2009
Single Sign On Help
Labels:
Sharepoint
http://www.thorprojects.com/blog/archive/2008/08/02/moss-single-sign-on-setup-step-by-step.aspx
Important Paths for Creating custom theme in sharepoint
Labels:
Sharepoint
SpThemes.Xml -- C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033
Theme folders -- C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES
mycustomtheme.gif - C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES
Theme folders -- C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES
mycustomtheme.gif - C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES
Tuesday, September 29, 2009
Increase the size of Site Template or List Templates
Labels:
Sharepoint
Run following command to the server:
stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 50000000
stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 50000000
Monday, September 21, 2009
Sharepoint Installation Help
Labels:
Sharepoint
http://technet.microsoft.com/en-us/library/cc263202.aspx
Thursday, September 17, 2009
Download ifilter for Sharepoint PDF Search
Labels:
Sharepoint
http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=2611&fileID=2457
Change default action of the workflow task in Sharepoint
Labels:
Sharepoint
It is good user exeprience if user can directly edit the task instead of going to View the task and then edit. or instead of going to ECB menu and then select edit item.
User should be edit the task using only single click. here are the steps to achieve this thing.:
Step1. Open master page. and put following javaScript code in the head part of the master page.
function GoToLink(elm)
{
try
{
if (elm.href==null)
return;
var ch=elm.href.indexOf("?") >=0 ? "&" : "?";
var srcUrl=GetSource();
if (srcUrl !=null && srcUrl !="")
srcUrl=ch+"Source="+srcUrl;
var editUrl, regExp;
var dispUrl = elm.href ;
regExp = /DispForm.aspx/i;
editUrl = dispUrl.replace(regExp, "EditForm.aspx");
var targetUrl= editUrl + srcUrl;
if (isPortalTemplatePage(targetUrl))
window.top.location=STSPageUrlValidation(targetUrl);
else
window.location=STSPageUrlValidation(targetUrl);
}
catch(e)
{
alert(e.description);
}
}
Step 2. Make Defer="false" in following markup code in the master page.
3. THe default action of task has been changed to edit item.
4, isnt it cool user experience??
User should be edit the task using only single click. here are the steps to achieve this thing.:
Step1. Open master page. and put following javaScript code in the head part of the master page.
function GoToLink(elm)
{
try
{
if (elm.href==null)
return;
var ch=elm.href.indexOf("?") >=0 ? "&" : "?";
var srcUrl=GetSource();
if (srcUrl !=null && srcUrl !="")
srcUrl=ch+"Source="+srcUrl;
var editUrl, regExp;
var dispUrl = elm.href ;
regExp = /DispForm.aspx/i;
editUrl = dispUrl.replace(regExp, "EditForm.aspx");
var targetUrl= editUrl + srcUrl;
if (isPortalTemplatePage(targetUrl))
window.top.location=STSPageUrlValidation(targetUrl);
else
window.location=STSPageUrlValidation(targetUrl);
}
catch(e)
{
alert(e.description);
}
}
Step 2. Make Defer="false" in following markup code in the master page.
3. THe default action of task has been changed to edit item.
4, isnt it cool user experience??
Subscribe to:
Posts (Atom)
Blog Archive
- April 2007 (1)
- June 2007 (3)
- July 2007 (3)
- August 2007 (5)
- September 2007 (4)
- October 2007 (1)
- November 2007 (1)
- December 2007 (1)
- January 2008 (5)
- February 2008 (1)
- March 2008 (2)
- April 2008 (10)
- July 2008 (8)
- September 2008 (1)
- October 2008 (2)
- November 2008 (1)
- January 2009 (2)
- April 2009 (4)
- May 2009 (4)
- June 2009 (5)
- July 2009 (11)
- September 2009 (5)
- October 2009 (9)
- November 2009 (8)
- December 2009 (3)
- January 2010 (1)
