0

I try to do something like this on my list Schema.xml to change default forms to the ones I've created.

 <Forms>
  <Form Type='DisplayForm' Url='DisplayForm.aspx' Path='_layouts\B2BMartin\FormDisplay.aspx' WebPartZoneID='Main' />
  <Form Type='EditForm' Url='EditForm.aspx' Path='_layouts\B2BMartin\FormEdit.aspx' WebPartZoneID='Main' />
  <Form Type='NewForm' Url='NewForm.aspx' Path='_layouts\B2BMartin\Form.aspx' WebPartZoneID='Main' />
</Forms>

This creates the following error during "Activating features" in deployment.

Error occurred in deployment step 'Activate Features': The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

When I add forms manually in SharePoint Designer to my list content type, it works just fine, but I have to do this every time I deploy my features...

enter image description here

Please help.

0

its states in the error that it cannot find the file. change the url to the layouts folder:

 <Forms>
  <Form Type='DisplayForm' Url='DisplayForm.aspx' Path='layouts\B2BMartin\FormDisplay.aspx' WebPartZoneID='Main' />
  <Form Type='EditForm' Url='EditForm.aspx' Path='layouts\B2BMartin\FormEdit.aspx' WebPartZoneID='Main' />
  <Form Type='NewForm' Url='NewForm.aspx' Path='layouts\B2BMartin\Form.aspx' WebPartZoneID='Main' />
</Forms>

go to your sharepoint layout folder on the server -> find the custom folder "B2BMartin" and make sure the three forms exist.

eg

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\B2BMartin\

EDIT

just to make it clear as per your example. your on 2016 and its folder is in 16 hive folder so the url should point to:

http://example.com/sites/B2BTest/_layouts/15/B2BMartin/FormDisplay.aspx

copy above in the browser to see if you can see the new form. It should work. the 15 is not refering to 2013. when in sp2016 iis points 15 to the 16 folder on the server. so your code should be:

 <Forms>
  <Form Type='DisplayForm' Url='DisplayForm.aspx' Path='_layouts\15\B2BMartin\FormDisplay.aspx' WebPartZoneID='Main' />
  <Form Type='EditForm' Url='EditForm.aspx' Path='_layouts\15\B2BMartin\FormEdit.aspx' WebPartZoneID='Main' />
  <Form Type='NewForm' Url='NewForm.aspx' Path='_layouts\15\B2BMartin\Form.aspx' WebPartZoneID='Main' />
</Forms>

so in your case your missing the "/15/" part that is referring to the 16 hive folder.

  • I have those forms in >C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\TEMPLATE\LAYOUTS\B2BMartin\ Changing path to "layouts\B2BMartin\..." doesn't work. Same error. – dext3rr Apr 25 '18 at 11:32
  • Maybe it's because my site works on 15 folder, but my layouts are inside 16? example.com/sites/B2BTest/_layouts/15/start.aspx#/SitePages/… – dext3rr Apr 25 '18 at 11:42
  • no its because its layouts is pointing in the location of the feature folder hence why it fails when activating because it basing it off the feature folder location not the actual layouts folder on the server. removing the '' points to the actual layouts folder. use _layouts when using it in a url like in a browser on the web, if you look in the hive error logs you would see it pointing in the wrong location hence the complaint it cannot find it ;) – Ali Jafer Apr 25 '18 at 12:13
  • so what should I use in the path attribute? "_layouts\..." doesn't work. – dext3rr Apr 26 '18 at 9:21
  • sorry missed your reply. yes test your url directly in the browser \LAYOUTS\ should point to the directory in the server. in any case _layouts\15\B2BMartin\ should work. 15 points to 16 folder on the server in iis – Ali Jafer Apr 26 '18 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.