SPT Blog

Customize Infopath Forms in SharePoint 2010 changes color theme to default blue (no visual upgrade)

I ran into this one when trying to customize a SharePoint 2010 form using the "Customize Form" button to add some custom colors on an InfoPath form for a SharePoint list. If you perform a visual upgrade in SharePoint 2010 everything works fine. However, if you do not do the visual upgrade, the page does not respect your color theme and reverts to the default "blue" theme. By pressing F12 in Internet Explorer, you can see what is going on: Notice how the core.css file is written out correctly and then overridden by the Obsidian color theme correctly. However, what is happening is that Infopath is adding another reference to core.css after the Obsidian color theme. Lines 7 and 8 of the "View Source" html show the correct order of CSS references with Obsidian after core.css However, InfoPath adds the following reference to core.css which overrides the Obsidian theme on [...]

By |2022-12-11T19:44:49+00:00September 4th, 2012|Sharepoint on Premise|1 Comment

Deleteing multiple event receivers error: Collection was modified; enumeration operation may not execute.

 This MSDN article has a nice section on adding and removing event receivers.  However, after trying their code below to delete an event receiver, it will fail if you try to remove multiple event receivers. you will get this error: Collection was modified; enumeration operation may not execute.         public override void FeatureDeactivating(SPFeatureReceiverProperties properties)         {             SPSite sitecollection = properties.Feature.Parent as SPSite;             SPWeb site = sitecollection.AllWebs["Docs"];             SPList list = site.Lists["MyList"];             foreach (SPEventReceiverDefinition rd in list.EventReceivers)             {                 if (rd.Name == "My Event Receiver")                     rd.Delete();             } To remedy this I specifically get the GUID's of each event receiver and then delete them declaratively..   public override void FeatureDeactivating(SPFeatureReceiverProperties properties)         {             SPSite sitecollection = properties.Feature.Parent as SPSite;             SPWeb site = sitecollection.AllWebs["Site Name"];             SPList list = site.Lists ["List Name"];             Guid Event1_Added = Guid.Empty;             Guid Event1_Updated = Guid.Empty;             foreach (SPEventReceiverDefinition rd [...]

By |2012-07-31T20:53:52+00:00July 31st, 2012|Sharepoint on Premise|1 Comment

My new friend to show all event receivers on a list

http://spm.codeplex.com/ Download the exe.  It provides a nice interface to drill down and show all the event receivers on a given list. A few notes on event receivers: In MOSS 2007, the Item Adding event has a null SPListItem, so use the properties.AfterProperties to get or set the fields before the item is added.  Also, the ItemID is null as the item has not been created yet. If using Item Added, you can access the list item through properties.ListItem. Use a Feature Receiver to deploy the event receiver.  This can be a class in the same project that installs on feature activate, and uninstalls on feature deactivate.    

By |2012-07-27T23:48:44+00:00July 27th, 2012|Sharepoint on Premise|1 Comment

PreUpgrade Check fun

Great article for fixing pre upgrade related issues: http://sharepointreporter.wordpress.com/2010/07/30/fix-pre-upgrade-check-errors/ One thing to add.  Use the query here to find the name of the pages that contain the offending webparts.  I thought deleting the page would make them go away, but I was wrong.  I had to recover the pages that I deleted from the recycle bin and then open them in web part maintenance view (appending "?contents=1" to the url and then delete the webparts from the page.   http://surfpointtech.com/2012/06/28/how-to-find-a-sharepoint-webpart-name-from-the-id-or-guid/  Here's the STSADM commands: STSADM -o preupgradecheck and this one to find the sites that the webparts live in: stsadm -o enumallwebs -includewebparts > i:tempwebparts.txt Better yet, use the SQL command above to get the actual page that the webpart lives in.  

By |2012-06-28T20:02:46+00:00June 28th, 2012|Sharepoint on Premise|1 Comment

How to find a SharePoint webpart name from the ID or GUID?

SELECT DISTINCT D.SiteID, D.WebId, W.FullURL as WebURL, D.Id As DocumentId,                  D.DirName, D.LeafName, tp_ID As WebPartSK  FROM       dbo.Docs D WITH (nolock)   INNER JOIN dbo.Webs W WITH (nolock) ON D.WebID = W.Id  INNER JOIN dbo.WebParts WP WITH (nolock) ON D.Id = WP.tp_PageUrlID  WHERE WP.tp_ListId Is Null AND WP.tp_Type Is Null AND WP.tp_Flags Is Null        AND WP.tp_BaseViewID Is Null AND WP.tp_DisplayName Is Null         AND WP.tp_Version Is Null  AND WP.tp_WebPartTypeId='<your web parts id>'  Source for this query is Ryan's comment her: http://stackoverflow.com/questions/1498409/sharepoint-find-where-webpart-is-in-use    

By |2012-06-28T16:35:19+00:00June 28th, 2012|Sharepoint on Premise|3 Comments

Installing Adobe 9 IFilter x64 for SharePoint 2010

Ran into some issues after running through the install: http://support.microsoft.com/kb/2293357 Search would still not pick up the content of the pdf, just the title. Had to add this registry key and start a full crawl and it worked: • Using Regedit on the server, navigate to \HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupFilters • Right-click the Filters folder and select New Key. Enter “.pdf” for the key value. • Add the following values to this key: Default = Extension = pdf FileTypeBucket = 1 MimeTypes = application/pdf

By |2022-12-11T19:44:49+00:00May 8th, 2012|Sharepoint on Premise|0 Comments

SharePoint Limits

These are some limits found in the 2007 version of SharePoint, specifically Windows SharePoint Services 3.0.   Site object Guidelines for acceptable performance Notes Scope of impact when performance degrades Site collection 50,000 per content database Total farm throughput degrades as the number of site collections increases. Farm Site collection 150,000 per Web application This limit is theoretical, and is dependent largely upon: Performance of the database server on which the configuration database resides. Performance of the Web servers in the farm. Network bandwidth between the Web servers and the database server. This is not a hard limit, and assumes a single database server. Your environment may not be able to host this many site collections per Web application. Distributing content databases across additional database servers can increase the effective limit of the number of site collections per Web application. You should perform testing to determine the actual effective limit [...]

By |2022-12-11T19:44:49+00:00March 26th, 2012|Sharepoint on Premise|0 Comments

SharePoint AuditData table is too large- Powershell script to schedule STSADM -o TrimAuditLog

If you have turned on Audit logging in SharePoint 2007, you will wake up some day with a nasty surprise of a bloated SQL server database.  The data is all being stored in the AuditData table in the content database. Luckily, there is an STSADM command for this, "stsadm -o trimauditlog" After some research, the general consensus is to not truncate the table directly, although no specific reason is ever given except "Not Supported." As I always prefer to use a standard API, I found that you must do this command in very small chunks or else you could lock up your SQL server and effectively crash your SharePoint installation (found out the hard way). I found 800,000 records to take approximately 15 minutes on a 2 Web Front end 1 Index Server, SQL Cluster type SharePoint farm.  To be safe, I wrote a PowerShell script to take care of [...]

By |2022-12-11T19:44:49+00:00February 1st, 2012|Sharepoint on Premise|1 Comment

Pull users and groups from a SP list that allows multiple users and groups. This is a follow up post from a previous post : http://surfpointtech.com/2011/09/12/how-to-pull-the-email-addresses-from-a-sharepoint-user-field-allow-multiple-users/ When examining a User field on a SharePoint list, you need to see whether the list setting allows for multiple users as well as both Users and Groups. The key to pulling both the groups and the users is to be able to test for a group as opposed to a user object.  In this case, I found that the fieldUser.User object is null for groups, but not for Users.  So, as you iterate through the fieldUser objects in the SPFieldUserValueCollection, you'll find a group when the fieldUser is not null, but the fieldUser.User object is null.  That way, you know you have a SPGroup at that point, and can loop through the users in the group. After that, you do the normal adding [...]

By |2012-01-31T23:42:51+00:00January 31st, 2012|Sharepoint on Premise|0 Comments

SharePoint Error in Visual Studio Debugging a workflow: Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))

Leave it to Microsoft to break every SharePoint Dev server in the world in one fell swoop. When you go to debug a workflow from Visual Studio 2008, it builds fine, but on deploy, it fails while trying to attach to the list with this error: Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT)) Causing the Error: Security patch KB2493987 If you have automatic updates set on your dev servers (which many people do), you will automatically get this security patch.  And, it will break all your custom visual studio debugging abilities on all dev servers. Solution: = Running the SharePoint Products and Technologies Configuration Wizard and doing an IISRESET. For a full explanation, see this helpful post: http://deinfotech.blogspot.com/2011/09/sharepoint-2007errors-creating-site-and.html

By |2022-12-11T19:44:49+00:00October 25th, 2011|Sharepoint on Premise, Uncategorized|0 Comments
Go to Top