1
votes

I have a sharepoint-hosted application and some lists within this app. I want to replace default new form with my own page. I've modified schema.xml for the list:

    <Forms>
      <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="NewForm" Url="NewForm.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\Pages\Default.aspx" WebPartZoneID="Main" />
    </Forms>

But there is an error during deployment "Cannot find the file specified". How can I point to my page in sharepoint-hosted application list schema.xml?

2

2 Answers

0
votes

From what I can see, I think you should change your backslashes in each of the setup paths to forward slashes, as they refer to specific places within the SharePoint application on IIS.

0
votes

If you have the form within the same folder as the List:

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

or if you have your custom form within a Pages folder:

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


IMPORTANT:
Don't forget to right-click the custom form and select Properties,
then set Deployment Type: ElementFile