Sunday, March 10, 2013

How To Deploy Custom List Forms With Data Form Webpart?

To Deploy list instances along with Custom New/Edit/Display Form, You can follow these steps
1)In SharePoint Designer
 Select  List and Librararies --->Preview Custom Forms in Browser-->Edit this Page in browser
 and export the DataForm Webpart

2)Edit the .Webpart file in Visual studio to remove  parameters for WebUrl (ctrl F +search for Weburl and remove it)
replace all occurrence of ListID to ListName and the Guid with the Name Of the List
and save .webpart file
In Webpart Properties remove ListName Property

3)Upload this Deployable Datformwebpart and Edit the Custom List Pages to Add this new Webpart
 and Remove the existing one.
In Visual Studio, Create the Module under ListInstance folder to provision Custom Form
(You can get this module from exported wsp to Visual studio of required site template which is saved as wsp)
Open the elements.xml file of the module and replace the CData of Dataform Webpart obtained in step 2
(If you need additional help , pls drop a comment)

4)Now to Deploy with ListInstance Follow the steps given here

After reading this artical I found that, Dataform Webpart will not work as it depends on List Guids

Also Check this url, which dynamically replaces tokens with Guids and custom pages are the sites pages

No comments: