For my work, I need to add a custom action named "Change Status" to change the status of a Task list item. So, I modified the "EditForm.aspx" and created a new form named "ApproveStatus3.aspx" by using sharepoint designer. This page only edits the Status field of that item. Then I followed these steps:
1. Create a new folder, called "ChangeStatus", in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES
2. Create an empty Xml file, called "feature.xml" in the "ChangeStatus" folder or you can copy and paste the same "feature.xml" file from other feature folder
3. Empty the feature.xml file and add the following content
<?xml version="1.0" encoding="utf-8" ?>
<Feature Title="Change Status"
Description="Changes only the status of the leave letter."
Scope="Site"
Id="C0B8CB6D-6DD9-4c89-A1DC-E97A4745875C" xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="Elements.xml" />
</ElementManifests>
</Feature>
4. Create an empty Xml file, called "Elements.xml" in the "ChangeStatus" folder or you can copy and paste the same "feature.xml" file from other feature folder
5. Empty the file and add the following content
<
<CustomAction Id="ApprovalList.ChangeStatus"
RegistrationType="List"
RegistrationId="107"
Location="EditControlBlock"
Sequence="100"
Title="Change Status"
ImageUrl="/_layouts/images/TaskPane.gif">
<UrlAction Url="http://svradm002:11226/lms/Lists/ApprovalList/ApproveStatus3.aspx?ID={ItemId}&Source=http%3A%2F%2Fsvradm002%3A11226%2Flms%2FLists%2FApprovalList%2FMyItems%2Easpx" />
</CustomAction>
</Elements>
6. Run command prompt, and nevigate to sharepoint's BIN folder... cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN Press enter.
7. Install the new feature by running the following command:
Stsadm –o installfeature –name changestatus
8. Activate the new feature by running the following command:
Stsadm –o activatefeature -name changestatus -url http://svradm002:11226/lms/
Here, registration id="107" menas this feature will be added with the drop down menu for items in task lists.
sequence="100" will probably place this item at the top most position of the drop down list. Increase the sequence number if you want to place it somewhere below.
in the url section, http://svradm002:11226/lms/Lists/ApprovalList/ApproveStatus3.aspx? is the location where I saved my custorm editing form. ID={ItemId} passes the current item that has been clicked on. Source=http%3A%2F%2Fsvradm002%3A11226%2Flms%2FLists%2FApprovalList%2FMyItems%2Easpx holds the return address when the editing will be done. normally you can pass the address for "allitems.aspx" page from the browser's address box.