Tuesday, January 10, 2012

Attachments and Custom Forms using SharePoint Designer 2010

If you're going to customize forms in SPD 2010 (or SPD 2007 for that matter), be aware of a few things where attachments are concerned- When creating custom SharePoint forms via SPD (aspx, not InfoPath), many people only hide the original form by setting "isVisible" to "false" then adding a custom list form to the page. Setting isVisible to False.
If you do, you're likely to get a save conflict along the lines of "Failed to get value of the 'Attachments' column from the 'Attachments' field type control blah blah blah... "
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)..


Some work arounds:


If you want to keep attachments enabled:
Delete the original form. Don't just hide it! Hiding it only keeps it from displaying though the browser. The Attachment control is still there and the two form's attachment controls will conflict with each other.


If you don't need attachments you could do either of the following:
Disable attachments before you create a custom form.
Disable attachments warning message.
This will make your life a lot easier. But it may not be feasible if you're asked as often as I am to make customized forms after someone else has created the list.
-OR-
Edit the attachment control and display in the XSLT. Comment out the "SharePoint:AttachmentUpload" control in the dvt_1 template.
Comment out SharePoint:Attachments control in XSLT
Then comment out the "Attachments" row in the XSLT as well. Just to be tidy. That's usually at the bottom of the dvt_1.rowedit template.
Commenting out Attachments row in XSLT
You should be good to go!

CG


No comments: