Monday, 4 August 2014

Create List Custom Form in SharePoint 2013 App

Create List Custom Form in SharePoint 2013 online App

Custom NewForm.aspx
Custom EditForm.aspx

Create new Empty SharePoint project
Click on App
Creare New SharePoint App
Name it: MyApp
Right click SharePoint project > Add New Item > List > Provide List Name “MyList” and click Add.
Right click new List (Under MyList)> Add New Item (Text File) > Provide File Name “CustomNewForm.aspx” and click Add. (Not under pages folder..)
Set CustomNewForm.aspx Deployment Type as “Element File”.

Write your own code in "CustomNewForm.aspx"
Open Schema.xml under MyList.
update the Form element for New Form. When UseLegacyForm attribute set to “FALSE”, a default list web part to a custom new form page inside web part zone “Main”.

Ex:

<Form Type="NewForm" Url="CustomNewForm.aspx" Path="CustomNewForm.aspx" WebPartZoneID="Main" UseLegacyForm="FALSE"  />

Build
Deploy
When you click New item from list
You will see CustomNewForm.aspx