![]() |
Enterprise Systems »
SharePoint Server »
General
Intermediate
License: The Code Project Open License (CPOL)
Multiple Edit Form for Sharepoint List ItemBy MJ FerdousHow to customize New or Edit Form (NewForm.aspx or EditForm.aspx). How to make multiple custom edit form for different item status. How to link those Forms with the list item by creating custom link column |
Office, Visual-Studio (VS2005, VS2008), Architect, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
This article is useful for the following reasons:
When you want to enter an edit item into, let’s say, your Issue Tracker list, SharePoint calls upon the EditForm.aspx page for that list. The page contains a customized List Form Web Part which cannot be edited within the web part, so in order to accomplish this, I use SharePoint Designer 2007 tool and Visual Studio .NET extension for SharePoint List Definition Template. Also I explain how to make different Edit form and depending on the list status, the edit link will redirect in different edit page. Here is the technique to do it.
During my Bug Tracker website development on MOSS platform, one of the tasks was how to customize the edit view of issue tracker list for the user of the site and also make different edit form for different issue status. EditForm.aspx page contains a List Form Web Part which displays default columns associated with the Issue Tracker list properties. The first problem was to customize edit form because of default webpart and the second problem was to make a different edit view depending on status. Also the last problem was to link different edit view for different status. I solved the problem one after another with the help of other online articles and my colleague.
You have to create a List Definition project of your specific list type (task, issue) for which you want to customize. Here, we will create Issue Tracking typelist definition using VS.NET Extension for WSS.
File > New > Project
ListDefinitionDemo”) IssueListDemo) If your deployment is successful, then the next step is to customize schema.xml file for custom column.
Note: The list will be deployed in the following location: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES.
After creating the solution using Visual Studio .NET, it is necessary to add customize edit column in schema.xml to build dynamic hyperlink so that the user can see the actual edit form layout (different edit page, e.g. EditPage1.aspx) depending on the item status. Add a new hyperlink column and build a dynamic href link in the following way:
<view url="MyItems.aspx" webpartzoneid="Main" type="HTML" baseviewid="2">
<viewfields>
<fieldref name="Attachments">
</fieldref>
. . .
<fieldref name="CustomEdit">
</fieldref>
</viewfields>
. . .
</view>
The sample code would look like this which you have to add inside <!--<fields>…</fields> -->: Put new GUID id for field ID using guidgen.exe tool from VS.NET command tool.
<fields>
. . .
<field id="{CEA7C7CF-238E-48c1-8DEA-F1ED2D038C0E}" name="CustomEdit"
type="Computed" hidden="FALSE" readonly="TRUE" displaceonupgrade="TRUE"
displayname="Modify" classinfo="Menu"
sourceid="http://schemas.microsoft.com/sharepoint/v3" staticname="CustomEdit"
frombasetype="TRUE">
<fieldrefs>
<fieldref name="ID">
<fieldref name="Status">
</fieldrefs>
<displaypattern>
</displaypattern>
</field>
</fields>
| You must Sign In to use this message board. | |||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads.
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 9 May 2009 Editor: Deeksha Shenoy |
Copyright 2009 by MJ Ferdous Everything else Copyright © CodeProject, 1999-2010 Web20 | Advertise on the Code Project |