none
Modify EditForm.Aspx on SharePoint

    Question

  • I am trying to create a button control on the Custom List Form webpart which needs to insert a New List Item into the custom list. The OK button basically updates the corresponding list item.

    Requirement: Save historical data of the list item. The fields need to be auto populated from the existing list item just like the EditForm.Aspx functionality. When users click ok, the Modified list item should be inserted as a new list item.

    So far what I have tried:  

    Made a copy of the existing editform.aspx.

    Delete the Listformwebpart.

    Insert a custom list webpart from the custom list control.

    Changed the control mode to New and modified the databind from 'u' to 'i' Eg: ddwrt:DataBind('i',....)

    But would not work.

    Got any idea how to go by with this. Does SharePoint support this kind of modification.

    If this idea does not work, I will have to go by creating a simple buttom and integrate it to JavaScript.

    Thanks in advance - Hari

     

     

     

    • Edited by Mike Walsh FIN Friday, May 07, 2010 7:45 PM Final sentence removed. *You* are asking for help, you won't get it by being rude.
    • Moved by Mike Walsh FIN Friday, May 07, 2010 7:45 PM customization not programming (From:SharePoint - Development and Programming (pre-SharePoint 2010))
    Friday, May 07, 2010 6:56 PM

Answers

  • Hello SympMarc,

     I came up with a solution by creating a Form action button from the SharePoint Toolbox in the SP designer.

    You can create a workflow and publish the list item as a new row by creating one.

    You will have to create a new copy of the Editform.aspx to do this.

    Steps to Create One.

    Drag-N-Drop a Form Action Button control.

    Right Click on the button to select Form Action.

    In the dialog box click on custom settings Click on Settings once you add the custom settings.

    This will take you to the workflow designer.

    It is going to be a single step workflow where you would specify the custom list, the variable and mapping on the form fields in the action item of the workflow.

    Regards Hari

    Tuesday, May 11, 2010 2:56 PM

All replies

  • Hari:

    It's a little difficult to understand what you are trying to do, but wouldn't turning on versioning accomplish what you need?

    M.


    Marc D Anderson - Sympraxis Consulting LLC - Marc D Anderson's Blog - @sympmarc - jQuery Library for SharePoint Web Services (SPServices)
    Monday, May 10, 2010 3:54 AM
  • Thanks Sympmarc for your reply.

    Versioning would not work for me.

     

    The requirement is to use multiple views on the list and only the admin should have the right to edit/modify in datasheet view. Users would enter future data. But the view should only display today's data. A filter would be added on the date field to check the data for previous dates.

    Say users enter the data for future dates modifying the already existing row data and the view will display the todays data. The concept is just like a historical data but acting on each row rather than each cell. The data for each day would be saved and the data has to be modified.

    My editform.aspx would contain an Update, Create New and a Cancel button to accomplish this task. I created the control for Create New with the existing record details pre-populated. the control would be SharePoint:SaveButton with the databind field being "i" parameter which obviously is not working for me.

     

    The other work around would be to populate the NewForm.aspx with the list item values using a query string of the list item title. But this would add up a whole lot of custom coding and to validate the controls with the form control tag name and mapping it.

     

    Please feel free to suggest any solution. I am open to all suggestions.

     

    Thank you.

     

     

    Monday, May 10, 2010 9:08 PM
  • Hello SympMarc,

     I came up with a solution by creating a Form action button from the SharePoint Toolbox in the SP designer.

    You can create a workflow and publish the list item as a new row by creating one.

    You will have to create a new copy of the Editform.aspx to do this.

    Steps to Create One.

    Drag-N-Drop a Form Action Button control.

    Right Click on the button to select Form Action.

    In the dialog box click on custom settings Click on Settings once you add the custom settings.

    This will take you to the workflow designer.

    It is going to be a single step workflow where you would specify the custom list, the variable and mapping on the form fields in the action item of the workflow.

    Regards Hari

    Tuesday, May 11, 2010 2:56 PM
  • Hello Hari,

    I am completely new to Sharepoint and a total dummy! This is exactly what I am looking for - I have a site and there is a list. I need to edit a list item and save it as a new list item. What I have got on EditForm.aspx at the moment is two button 'OK' and 'Cancel' . The 'OK' button saves the changes in the same list (as expected). What I want to achieve is perhaps another button called 'save as' which would create a new list item (I want the original one intact).

    From your post above I think you have achieved this. I follow the step, open the site in the SP Designer 2007 and goto the EditForm.aspx and open it. Its not allowing me to add a button (drag and drop as you said) as I think its protected(?) and is in a image mode (?).  When I select the panel (the page is in design mode), I can see a tiny tab with the name 'WebPartPages:ListFormWebPart'. Is this the right way to modify the EditForm.aspx?

    Any help is welcome.

    Thanks.

    Aparna

     

     

     

    Tuesday, July 06, 2010 3:22 PM
  • Hello Hari,

    Ok I have managed to get the button on the EditForm.aspx. I have created a workflow for the form action. I have used copy list item action. My problem now is I am unable to get the 'current item' if I go though this way to create a workflow. How do I get the current item? There is a GUID for every list item however how do I get it when I am in the EditForm.aspx?

    The 'Current Item' is available in the workflow when you create a workflow from File--> New ---> Workflow (when u create a workflow and attach it to a list.).

    Please advice how have you achieved this?

    Thanks,

    Aparna

     

     

     

    Wednesday, July 07, 2010 1:48 PM