Tuesday, September 23, 2014

Fixing Multiple Save, Cancel Buttons and Attachments Fields on Add, Edit, Modify Pages for Lists Created in Visual Studio

Today I ran into a problem where my custom list instances deployed through visual studio were showing up with multiple save/cancel buttons and attachment fields. Worse yet, adding a new item or modifying an existing through the following error:

Failed to get value of the "Attachments" column from the "Attachments" field type control.  See details in log. Exception message: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)..

The form itself looked like the image below:



The problem was in the Elements.xml in the list pages folder in my list instance.

There should be one web part for each "FormType". The form types are 4, 6, and 8. Therefore, we should have a total of 3. Instead I had 9, 3 for each type.

To fix the error search for "<FormType" within the document and make sure you have only one web part for each form type. If you have extras, just delete them.

No comments:

Post a Comment