Monday, July 12, 2010

Create a custom list form (EditForm) with few Read only fields And Associating with A List

Creating Cusotm EditForm Page for this test list and enabling few fields as read only
Step 1
Open site with sharepoint desingner
http://madhunomula/RND


Step 2:
Browse the perticular list
Lists--> Test List-->
Step3:
Copy the EditForm and Paste in the Same location
Step 4:
Checkout the copied form and rename to EditFormNew.aspx
Open this form in designer and remove the existing Data form webpart from webpartzone
Step5:
File --Edit--View--Insert----->Sharepoint Controls--> Custom List Form,
Now select the List Name and Select the form type as Edit Item Form
Step6:
Now in Disign click on the control ex Title
And in code view change the control property ControlMode="Edit" to "Display"

Note:
It is not possible to ControlMode="Edit" to "Display" for Dropdown list, date time control, peopl picker control,
So right click on the control and change Format Item As Text and change the disable-output-escaping as yes
xsl:value-of select="@Decision" escaping="yes"




Associating This Page with A List

After you create a custom list form, you can associate it with the list for which it was created. Until you associate the custom list form with the list, the custom list form will not appear in the browser when users create, view, or edit items in that list.

In the earlier example, you created EditFormNew.aspx for the Test list,

so the next step is to associate EditFormNew.aspx with the Test list.

1.In the Folder List, right-click the list or library with which you want to associate the custom list form — in this example, Test List— and then click Properties on the shortcut menu.
2.In the List Properties dialog box, click the Supporting Files tab.
3.If your list is configured to allow multiple content types, in the Content type specific forms list, click the content type for which you want to use the custom list form.
Each time you change the content type, the text boxes change to display the forms used for the current content type. Each content type can use a separate set of custom list forms.

4.Under Disply item form, click Browse, locate and click the custom list form — in this example, EditFormNew.aspx — and then click OK.
The path to the custom list form now appears in the New item form box.

5.Click OK.
If you have followed the example, you can test the new custom form. To do this, click Default.aspx in the Folder List, and then click F12 to open the page in the browser. In the browser, under Announcements, click Add new announcement to open the custom new item form.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------
By Default append changes list data will not show in custom edit form

To overcome this issue add one more given line to the field following


< SharePoint:AppendOnlyHistory runat="server" fieldname="YourCommentsFieldName" controlmode="Display" >




No comments:

Post a Comment