Wednesday, August 29, 2012

Unable to find the default edit form for list...

So Exporting a Site as a Template and Importing it into Visual Studio can be very useful but only if it works!

I was trying to use this method to create a List and a Library Instance so I could include it into my existing solution.  I did this and it appeared as though everything worked well until I tried to upload a document in the library or create a new list item...then I would get a nasty error about
"Unable to find the default edit form for list My List"
So I looked back in the definition and for the list there was this SharePoint Module inside that was named 'Listslist_name_here_pages'and had a Elements.xml inside it with some information about the DispForm, NewForm and EditForm...

Perfect, so for the list I included this module just as it was in the other solution and low and behold it worked...but then the Library didn't have a module inside it...WTF!!! Then some more snooping lead me to see that there was a Modules folder that had 4 Modules with the corresponding names each with their own different Elements.xml files!
LibraryNameForms_1033_STS_doctemp_word
LibraryNameForms_Features_DocumentLibrary_doclib
LibraryNameForms_pages
LibraryNameFormsMy Custom ContentType_1033_STS_doctemp_word
NASTY!!!

So, being a slave to SharePoint I set out to duplicate these four modules just as they were in the imported solution...no dice...but then I got to thinking about how this works and I snooped into the Scheme.xml of the list instance and found this....
<Forms />
What?!? that's not right...so I blew away all my precious modules I worked so hard on and switched the above one line in the Scheme.xml for this...
<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="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
WOW! Its magic! just like It should be...and a much nicer, cleaner solution.

More information about the Scheme.xml can be found here

Tuesday, August 21, 2012

SharePoint 2010 Products Configuration Wizard "Configuration Failed"

Ever spent a full day (or more) trying to get SharePoint 2010 Products Configuration Wizard to work properly?

It seems like every time I have to run this thing it fails with that lovely "Configuration Failed" error message...and this is of course after 15-20 min and 92.57% or whatever random percentage it pulls out of the air.

You can dig through the logs, the "Upgrade-datestamp-timestamp-randomnumber-error.log" log file often has much more informative information in it that the "PCDiagnostics_datestamp_timestamp_randomnumber.log" that the wizard recommends.

So, after that then what?

Never fear, Command Prompt is here!

Run this command from a SharePoint 2010 Management Shell prompt and 9 times out of 10 it will work...I don't know why i don't just do this to start with.
PSCONFIG.EXE -cmd upgrade -inplace b2b -force
there are many different switches you can add to this command all of which may or may not help but this is the one that i use the most.