A few days ago I started making a custom NewForm.aspx for a list with Sharepoint Designer. I started hiding the default list form webpart and inserted a custom list form. I tweaked this the way I wanted and it worked like charm. But, with testing I found out that I couldn’t upload any attachments. When I clicked the “Attach File” button nothing happens.

I debugged the javascript that was behind the “Attach File” button. There I found the following piece of code:

function ShowPartAttachment()
 if (document.getElementById("part1")==null ||
 var L_FormMissingPart1_Text= "This form was customized not working with attachement.";

You can see that it tries to hide part1 and shows partAttachment. In my source I found both spans, but the part1 span was holding the hidden listview webpart that was off course already hidden. This is just another bug in Sharepoint Designer.

I started searching the internet for a fix to this problem and came along a post that refers to the following hotfix for sharepoint designer http://support.microsoft.com/kb/960311 and WSS update http://support.microsoft.com/kb/951695. After applying these fixes, I recreated the custom listview. You can also manually edit an existing custom listview by applying a few lines of code that is given here http://support.microsoft.com/default.aspx?scid=kb;en-us;953271&sd=rss&spid=11373, but I recommend deleting and recreating the listview.

This however didn’t solve anything. When I looked a bit closer at the code I saw that the “part1” span was in place and it theoratically should work. After spending some hours to solve this problem I tried to delete the hidden listview, cause I thought it might interfere, and it did! It’s quite obvious because two spans with the id “part1” are on the page and it hides the first one.

We are working with Sharepoint and one typical Sharepoint issue is that when one problem is solved the next pops up. And indeed this is the case. The form worked fine when I did go to AllItems.aspx, but it now throws an error when clicking “New” in the list overview saying “Invalid page URL” and some users getting “An unexpected error has occurred”. The solution is fairly simple: just don’t delete the List Form Web Part, but I did already =|. So I copied the List Form Web Part from a backup back to the site. If you ran into the same situation but don’t have a backup, don’t bother inserting a new List Form Web Part but just copy it from your EditForm.aspx and doing some small modifications. Here are the instructions for doing this: http://blogs.msdn.com/dszabo/archive/2007/02/20/custom-list-newform-aspx-ruined-in-wss-3-0.aspx

Now when I was back where I started I just moved the custom Listview to the top by dragging and dropping in Sharepoint Designer making it the first webpart on the screen. This did solve allmost everything, I could open the new form normally and upload attachments to it.

However as I said before, when one problem is solved the next pops up. Now, when I fill the form and save it I get a brand new 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 attachments of the two webparts are conflicting so I made the compiler convince that the hidden List Form isn’t a ListForm by edit the following line in the NewForm.aspx in sharepoint designer:

<TemplateName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">ListForm</TemplateName>


<TemplateName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">NoListForm</TemplateName>

this way the hidden List Form is still there but doesn’t conflict. The form works perfectly fine for me now.


I found out that for the first new item in the list I cannot attach any files, because there is no “attach file” button. For any other new item it worked, but simply not the first one =S

However, there is a solution to this also. Just change the following in the NewForm.aspx and everything will work fine:

<ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Edit</ControlMode>


<ControlMode xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”>Display</ControlMode>

Another update:

Some readers had a problem which is described as “When I try to add attachments to an existing list entry (Edit form) the file attachment dialog doesn’t close when hitting OK.”or “When i click the button to “Attach File”, I now get to the page where I can attach a file, however, after selecting a file when I click “Ok”, nothing happens and I get an “Error On Page” ”

Now one of my readers came with a solution to this problem. When you click on the “OK” button of the attach dialouge after selecting a file, a javascript action occurs, where it takes your selected file and adds it to a table with ID= “idAttachmentsRow”. Now, if this table does not exist, then you will get a javascript error on the page. The reason this table doesnt exist for you is because you have modified your custom new/edit form in the past and deleted your attachments form field. Without the attachments form field you cannot complete the attachment use case. I think the following code will help you (it is tailored for edit forms, but a few small changes it will work for new forms as well)

var elm = document.getElementById(“idAttachmentsTable”);
if (elm == null || elm.rows.length == 0)


Just make a new page. in the new page, add a custom list form. Look at the code generated for the custom list form. At the bottom, it will have your attachments field that you are probably missing. Copy and paste that attachments field into your problem form and you should be good to go.

Credits go to pete w for these solutions.

Sharepoint Hotfixes

June 23rd, 2009 | Posted by Jeffrey Paarhuis in Good to know - (0 Comments)

At http://mastermoss.wordpress.com I got this very handy list of hotfixes to common sharepoint issues.

MOSS – Potential memory leak within our LDAP security provider when using Forms Authentication.http://support.microsoft.com/kb/939599

WSS – Invalid link sent in InfoPath12 Form Server workflow email. http://support.microsoft.com/kb/939592

WSS – Tool to rename domain named site (Office Live). http://support.microsoft.com/kb/939535

SEARCH – Search does not return files with a space in the filename. The filename property is stored with an encoded %20 instead of a space. http://support.microsoft.com/kb/939592

MOSS – User Profile doesn’t get updated from AD. http://support.microsoft.com/kb/939592

SEARCH – Managed Property created through OM are being recreated when search crawl happens (full or incremental) (MSAP).http://support.microsoft.com/kb/939654

WSS – Response.End() after blob streaming causing performance impact on x64 platform. http://support.microsoft.com/kb/939077

SEARCH – Duplicate Best Bets should not be allowed (MSIT). http://support.microsoft.com/kb/939077

WSS – Content deployment – The file ‘XXXX’ is not checked out… (DHS). http://support.microsoft.com/kb/939188

WSS – CDCR:Tool request to automate site collection repartitions (Office Live). http://support.microsoft.com/kb/939035

WSS – NAME.DLL wrong versioning causes crash in IE in OWSSUPP.DLL. http://support.microsoft.com/kb/938888

WSS – Special character encoding problem during content deployment in combination with variations.http://support.microsoft.com/kb/938536

SEARCH – Modified date in search result is shown as yesterday/tomorrow date. http://support.microsoft.com/kb/938537

SEARCH – “View by Modified Date” does not work fine after Incremental Crawl. http://support.microsoft.com/kb/938536

WSS – One-Time timer jobs cause 2 hour delay in backup and restore when DST in effect. http://support.microsoft.com/kb/938663

MOSS – The kpi creation succeeds and shows kpi with green status if the cell has ‘#NAME?’ because of incorrect formula calculation.http://support.microsoft.com/kb/938182

WSS – Attachment for item in content approval enabled List disappears after edited. http://support.microsoft.com/kb/938183

WSS – Unable to use ‘e-mail as a link’ feature in WSS 3.0. http://support.microsoft.com/kb/938241

SEARCH – Cannot search for anything beyond the first slide of a PowerPoint (ppt) presentation.http://support.microsoft.com/kb/937901

SEARCH – Search does not index or return results when DB Status is set offline. http://support.microsoft.com/kb/938569

WSS – DocLib with > 1000 folders with unique permissions causes error in sitedata webservice.http://support.microsoft.com/kb/937901

WSS – Groups on a higher site level will be deleted when subsite was created by an own template and deleted later.http://support.microsoft.com/kb/937901

WSS – Cannot delete a field of type “Computed” from the document library. http://support.microsoft.com/kb/937901

SEARCH – Define a scope when using the AdvancedSearchWebPart for entering the parameters and the CoreResultsWebPart to execute the search and display the results. http://support.microsoft.com/kb/938568WSS – Track Passport users by their PUID(Office Live). http://support.microsoft.com/kb/937498

WSS – CDCR:Request for external blob storage API (Office Live). http://support.microsoft.com/kb/938499

WSS – Non-RFC compliant extra ‘:’ in initial Workflow email causes mail to be interpreted as TEXT on non-Exchange systems.http://support.microsoft.com/kb/937906

MOSS – Users unable to create MySite. http://support.microsoft.com/kb/937207

SEARCH – Unable to search content of protected charts in Excel. http://support.microsoft.com/kb/937203

WSS – Check the canary header in addition to the form body (Office Live). http://support.microsoft.com/kb/937203

SEARCH – Lists with a null description are not returned when order determined by description field.http://support.microsoft.com/kb/937775

SEARCH – The Notes URL could not be converted in from http:// to notes:// even it is defined in the Server Name Mappings.http://support.microsoft.com/kb/937203

SEARCH – Browser Back button in “Advanced Search” hides search criteria in use (also for the following searches).http://support.microsoft.com/kb/936877

SEARCH – The word breaker for Traditional Chinese Names in the CHT version of MOSS is not Correct.http://support.microsoft.com/kb/937039

SEARCH – Override DB level permissions by using Readers Fields at the document level. http://support.microsoft.com/kb/936877

WSS – Need tool to clean up problem sites caused by the inheriting permissions bug OfficeQFE:18616.http://support.microsoft.com/kb/935958

SEARCH – Lag time when starting a crawl increases based on number of documents in system.http://support.microsoft.com/kb/936867

WSS – Documents do not maintain ‘modified by’ user information after export/import operation using stsadm.exe.http://support.microsoft.com/kb/936867

WSS – Inheriting permission causes destructive error : User can never access to the site collection.http://support.microsoft.com/kb/937038

WSS – In AD creation mode, Create User sends email even though check box is unchecked.http://support.microsoft.com/kb/936867

WSS – Web Part page Relative URL path is broken and result in “File Not found” unexpectedly.http://support.microsoft.com/kb/936867

SEARCH – Search queries intermittently timeout. http://support.microsoft.com/kb/936867

WSS – Forefront virus scanner generates error causing document upload to fail. http://support.microsoft.com/kb/936867

WSS – Removing user from site collection causes content deployment to fail. http://support.microsoft.com/kb/936867

SEARCH – Sites that require forms-based authentication or cookie-based authentication are not crawled in SharePoint Server 2007.http://support.microsoft.com/kb/934577

SEARCH – The starting of master merge failed on the AnchorProject and left the indexes marked as being already involved in merge. Subsequent merges do not start. http://support.microsoft.com/kb/936877

MOSS – You receive the following error message when you search for a GUID in SharePoint Server 2007: An error occurred while retrieving data from AdventureWorksInstanceBad. Administrators, see the server log for more information.http://support.microsoft.com/kb/934793

SEARCH – SharePoint Server 2007 cannot index a Microsoft Exchange public folder.http://support.microsoft.com/kb/934793

WSS – Issues that may occur when you use the volume shadow copy service (VSS) reference writer in Windows SharePoint Services 3.0http://support.microsoft.com/kb/935605

SEARCH – If you set the Hint property of a Full Text Query object to OptimizeWithFullTextIndex and then query the computer that is running Windows SharePoint Services 3.0, the order of the results is sorted incorrectly.http://support.microsoft.com/kb/934790

WSS – Error message when you try to install a feature in Windows SharePoint Services 3.0: “The ‘UserSelectionMode’ attribute is not allowed.http://support.microsoft.com/kb/934613

WSS – When you run a program that uses the SPWorkflowManager.ForceDehydrateHttpContextWorkflows() event to work with files that are saved in a Windows SharePoint Services 3.0 document library, the expected Web page is not displayed. Additionally, you receive the following error message: Service Unavailablehttp://support.microsoft.com/kb/934790

WSS – When you upload a file to multiple Windows SharePoint Services 3.0 document libraries, an alert creation e-mail message is sent from the document libraries as expected. However, an alert notification e-mail message is sent from only one document library. You would expect an alert notification e-mail message to be sent from all the document libraries to which you uploaded the file.http://support.microsoft.com/kb/934790

WSS – When you use the ItemAdding event to add a new file to a Windows SharePoint Services 3.0 document library, the path of the document library folder cannot be found.http://support.microsoft.com/kb/934790

WSS – A file that is attached to an e-mail message is not put in a Windows SharePoint Services 3.0 document libraryhttp://support.microsoft.com/kb/934882

SEARCH – You browse a Windows SharePoint Services 3.0 Web site that contains different language subwebs. When you search one language subweb for an item that does not exist, you receive an error message as expected in that language subweb. However, when you search for an item that does not exist in a different language subweb, you unexpectedly receive an error message in the first language subweb that you searched.http://support.microsoft.com/kb/934790

WSS – You run an SQL query to change the properties for a user that you created on a Windows SharePoint Services 3.0 Web site. When you run the PeoplePicker tool to search for a user, the original user is unexpectedly found. You would expect the PeoplePicker tool to use the changes that you made to the user’s properties when it searches for a user.http://support.microsoft.com/kb/934790

WSS – You add two List Web Parts to a page of a Windows SharePoint Services 3.0 Web site. The second List Web Part is connected to receive data from the first List Web Part. When you click the option button for an item in the first List Web Part, only that list item appears in the second List Web Part as expected. However, if you sort the results of the first List Web Part and then click the option button for a different item in the list, all list items unexpectedly appear in the second List Web Part.http://support.microsoft.com/kb/934790

WSS – The Web File Properties dialog box displays incorrect properties for a document that is saved in a Windows SharePoint Services 3.0 document libraryhttp://support.microsoft.com/kb/934253

WSS – A default column value is saved to a document regardless of the content type of the document in a Windows SharePoint Services 3.0 document libraryhttp://support.microsoft.com/kb/932922

SEARCH – No results are returned in the search results when you search for people by site membership in SharePoint Server 2007http://support.microsoft.com/kb/935196

WSS – E-mail alerts do not work when the server that is running Windows SharePoint Services uses port translation.http://support.microsoft.com/kb/933818

SEARCH – You cannot search Microsoft Excel workbooks in a Windows SharePoint Services document library.http://support.microsoft.com/kb/933818

SEARCH – Users receive search error messages and event ID 10038 error messages are logged in the Application log on Web front-end servershttp://support.microsoft.com/kb/933819

SEARCH – No documents are returned in the search results when a user searches for Lotus Notes content in SharePoint Server 2007http://support.microsoft.com/kb/933939SEARCH – When SharePoint Server 2007 crawls a Microsoft Exchange Server 2003 public folder, the following error message is logged to the gatherer log: “The item could not be accessed on the remote server because its address has an invalid syntax”http://support.microsoft.com/kb/933586

MOSS – When you select the Re-encrypt all credentials by using the new encryption key option to reencrypt credentials in a Single Sign-On (SSO) environment, the “IX_SSO_Credentials” index is renamed to “IX_SSO_Temp_Credentials.” When the SSO database is queried, the query fails.http://support.microsoft.com/kb/932917

MOSS – A URL that contains an extra slash mark may take longer to open on a server that is running SharePoint Server 2007http://support.microsoft.com/kb/932918

SEARCH – Complex remote links are not crawled when the links are in the same SharePoint Server 2007 portalhttp://support.microsoft.com/kb/932901

SEARCH – When you use the FulltextSqlQuery object to perform a full-text search of a server that is running SharePoint Server 2007, the search results may be sorted in random order.http://support.microsoft.com/kb/932917

WSS – You cannot disable VSAPI scans when you schedule manual scans of content in SharePoint Server 2007 and in Windows SharePoint Services 3.0http://support.microsoft.com/kb/933138

WSS – The file name of a file that you download from the Document Center is changed to use UTF-8 canonical format and is missing the file name extensionhttp://support.microsoft.com/kb/932914

WSS – You cannot create a content database after you install Windows Internal Database SP2http://support.microsoft.com/kb/932914

MOSS – You run a program that uses the SharedWebService.OnlineServerAddresses Web service to determine the URL for its search service. When several requests are made to the same Web service at the same time, a deadlock situation may occur.http://support.microsoft.com/kb/932919

WSS – Previously published pages that are no longer published cause duplicate links to appear in the Windows SharePoint Services 3.0 content database.http://support.microsoft.com/kb/932621

WSS – You receive the following error message when you try to open a form in Windows SharePoint Services 3.0: “The Page is modified. Please reopen it”http://support.microsoft.com/kb/932621

SEARCH – You cannot crawl case-sensitive Web content in SharePoint Server 2007http://support.microsoft.com/kb/932619

WSS – One or more custom programs do not finish successfully when you run multiple custom programs that use the BreakRoleInheritance function in the Windows SharePoint Services 3.0 object model.http://support.microsoft.com/kb/932056

WSS – When you try to show an error message in a Windows SharePoint Services 3.0 Web site programmatically by using the ItemCheckingIn() event, the custom error message text is not shown. Instead, you receive a garbled error message that may resemble the following error message: 1!.512s!http://support.microsoft.com/kb/931636

WSS – You cannot select the values for a custom field when you try to edit the properties on the FldEditEx.aspx page on a Windows SharePoint Services 3.0 Web site.http://support.microsoft.com/kb/932055

SEARCH – You cannot perform a search query after you upgrade to Windows SharePoint Services 3.0 on a Windows Small Business Server 2003-based computer.http://support.microsoft.com/kb/931008

SEARCH – When you search a Windows SharePoint Services 3.0 Web site and then click View by Modified Date, you receive the following error message: “Your search cannot be completed because of a service error. Try your search again or contact your administrator for more information.”http://support.microsoft.com/kb/931636

SEARCH – When you perform an incremental crawl on a Windows SharePoint Services 3.0 Web site, the crawl may stop when one or more of the following conditions are true; No changes are found, No new links are found or No new updates are found.http://support.microsoft.com/kb/931496

WSS – Changes that you make to the “List View” Web Part are not retained after you save the site as a template in Windows SharePoint Services 3.0.http://support.microsoft.com/kb/926284

WSS – When you try to delete a message in Windows SharePoint Services 3.0 programmatically, you receive a null reference exception message.http://support.microsoft.com/kb/931636

WSS – Microsoft Windows SharePoint Services 3.0 currently does not comply with daylight saving time (DST) in Western Australia for the years 2006 to 2009.http://support.microsoft.com/kb/932347

SEARCH – If the parent farm contains two or more start addresses that contain the same host in SharePoint Server 2007, efforts to provision the content sources fail.http://support.microsoft.com/kb/931496

OUTLOOK – When you locate a Windows SharePoint Services 3.0 custom list in Microsoft Office Outlook 2007, CPU usage that is reported in Task Manager may reach 100 percent. Additionally, CPU usage does not decrease until you exit Outlook 2007.http://support.microsoft.com/kb/935515

WSS – When you locate a Windows SharePoint Services 3.0 custom list in Outlook 2007, CPU usage as reported in Task Manager may reach 100%. Additionally, CPU usage does not decrease until you exit Outlook 2007.http://support.microsoft.com/kb/931637