Category Archives: Microsoft Office Sharepoint Server 2007

Alert Me function not available

Recently I was working on a project to upgrade a SharePoint 2007 environment to 2010 as as part of this was working on verifying the upgrade process on a test server. When we first upgraded the content databases the Alert Me functionality was visible in the UI and working. I knew this because users started to receive notifications from the test environment. To reduce confusion the SMTP server was removed from the SharePoint configuration. This obviously stopped email being sent from the server but it turns out that SharePoint 2010 is actually smart enought to realise that it can no longer send email notifications and as a result the Alert Me functionality disappears from the UI as well.  Add an SMTP server back into the farm and Alert Me functionality appears again.

SharePoint 2007 didn’t do this and I don’t recall reading or hearing anywhere that 2010 included this enhancement but it does. Nice as long as you realise it and don’t spend a whole lot of time trying to work out why Alert Me functionality is no longer available because your upgrade testers have lodged it as a defect ūüôā



Leave a comment

Filed under Microsoft Office Sharepoint Server 2007, Project Server 2007, Project Server 2010, SharePoint 2010

User Profile Service Error

I was configuring a fresh User Profile Application Service today and noticed that after I started the User Profile Synchronization Service from the Services on Server page, provided the password for the farm account,¬†the status changed to “Starting”, stayed that way¬†for maybe 10 minutes and the reverted back to “Stopped”.¬† I started investigating what was going on and found the following error in the event log multiple times…

Unknown SQL Exception 0 occurred. Additional error information from SQL Server is included below.

Cannot generate SSPI context.

Googling the error turned up some possibly useful content in the following article:

Microsoft Support: How to troubleshoot the “Cannot generate SSPI context” error message

One of the areas¬†the article point to possibly causing the problem was if the domain account used to access SQL was locked¬†out or has recently had its password changed. I checked if the account was locked out and it wasn’t which also confirmed for me that the password hadn’t been changed.¬†Obviously if the account had problems accessing the DB it could cause this problem so I checked that it had permission on SQL. Yes again. Finally I tried again to start the ¬†User Profile Synchronization¬†Service from the Services on Server page and then realised I had more than likely provided the SharePoint¬†Admin password but the service at that stage still wanted to start with the SharePoint¬†Farm account. Once I provided the correct password for the SharePoint Farm account the service started correctly.

Interestingly, supplying the incorrect password for the SharePoint Farm account didn’t cause it to get locked out on the domain. Thankfully!

Leave a comment

Filed under Microsoft Office Sharepoint Server 2007, SharePoint 2010

Problem rendering infoPath forms for External Lists

I was configuring a set of external content types and associated external lists the other day and encountered the following error message “The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator” when I create the lists to have associated InfoPath based forms (the ASPX based forms were still created).

The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator.

It turns out that because we chose to perform the configuration of services manually the config wizard wasn’t run and as a result the State Service wasn’t configured. To fix this problem we need to configure the state service either by running the config wizard through Central Admin or using the following process from within the SharePoint Powershell command window…

  1. Login to the server using the SharePoint Admin account
  2. On the Taskbar, click Start, point to Administrative Tools, and then open the Windows PowerShell Modules as administrator.
  3. In Windows PowerShell, create a service application by typing $serviceApp = New-SPStateServiceApplication -Name ‚ÄúState Service‚ÄĚ
  4. Create a State Service database and associate it with a service application, by typing New-SPStateServiceDatabase -Name ‚ÄĚStateServiceDatabase‚ÄĚ -ServiceApplication $serviceApp.
  5. Create a State Service Application Proxy and associate it with the service application by typing New-SPStateServiceApplicationProxy -Name ‚ÄĚState Service‚ÄĚ -ServiceApplication $serviceApp -DefaultProxyGroup.

Once these instructions are run, you should have a new State Service Service Application visible under the Service Applications list. You might also need to verify that your web Applications iare associated with the new State Service Service Application before things will start working properly.

Leave a comment

Filed under Microsoft Office Sharepoint Server 2007, SharePoint 2010, Uncategorized

Problems adjusting the list Sharepoint‚Äč:FormField width

I’ve been doing some work on a SharePoint 2007 application and¬†have a custom list where one column looks for data in other list. Everything works as expected but I¬†hit a problem with the formatting of the field on the New and Edit forms for the list. On the default forms the FormField doesn’t auto expand to show the full width of the text being reference as shown below…

I’ve used SharePoint Designer to create custom forms layouts a few times before and along with some formatting requests from the customer created a couple of custom form equivalents for the list. The forms work fine and the customer is happy with the formatting except for this width issue.
I tried a number of things from setting properties on the control to overriding what styles I thought were being applied but I still couldn’t find a way to adjust the width of the text boxes.¬†When I¬†tried custom CSS¬†I was at best only able to¬†adjust the width of the FormField control but the text boxes don’t auto resize (as shown below) even though you can see the control is now wider. We’ve tried adjusting the DisplaySize property on the control and it makes no difference either.

What seems to be happening when you look at the HTML behind the page is that the Form Field control (SharePoint:FormField) is outputing the select boxes wrapped in a DIV tag that uses inline styles and not a CSS class. This makes it difficult to override the width and height settings for the select boxes.

 One suggestion was to look for the next parent that has a sensible ID (not dynamic GUID) or class applied and override the styles making sure you use the !important operator to ensure that the inline style is overridden e.g.  something like: table:first-child span table div.areatemplate-selection-panel select {width: auto !important} 

After some discussion on the OzMOSS mailing list Mark Burns provided the following solution based on to idea wrapping the control in a named DIV tag and then using JavaScript on the body load to parse the tags inside the DIV and modify the height and width styles. For more detail on this approach to modifying styles refer to the SharePoint Designer Team Blog entry 

Relevant code I used is shown below:


<script type="text/javascript">
function removeLocalStyleAttributes() {
   var coll = document.body.getElementsByTagName("div");

   for(x=0;x < coll.length; x++)
      if(coll[x].className == "select-container") {
         var collDivControls = coll[x].getElementsByTagName("DIV");

         for(y=0;y < collDivControls.length; y++)
            collDivControls[y].style.width = null;
            collDivControls[y].style.height = null;
.select-container div{
                      height:400px; }
<td width="400px" valign="top">
    <div class="select-container">
          <SharePoint:FormField runat="server" id="ff13{$Pos}" ControlMode="Edit" FieldName="OSCompatibility" __designer:bind="{ddwrt:DataBind('u',concat('ff13',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@OSCompatibility')}"/>

Leave a comment

Filed under General SharePoint Development, Microsoft Office Sharepoint Server 2007

Problems Caused by IE Developer Toolbar

I’ve had a shocker of a time over the last day or so after I installed the IE Developer Toolbar on my new Windows 7 64bit laptop. I had been trying to debug some issues with a custom SharePoint list form and having used the toolbar on my old laptop to great benefit and with no problems have no hesitation installing it on my new one.

I downloaded the latest version (1.00.2189.0) and proceeded to investigate the issue with cascading styles in my page. The first problem that I started encountering was that some web sites (unrelated to the SharePoint customisation I was looking into) would simply hang. This seemed to get progressively worse to the point where I would have to restart the browser.

Next Microsoft Word 2010 started to intermittently hit problems and close down. Again this got progressively worse until everytime I tried to open a document (both .doc and .docx) Word wouldn’t even open it before¬† the error dialog appeared and off it went on its merry way trying to work out what went wrong, notify Microsoft and then close down.

Thinking that it could be related to the installation of the developer toolbar I reluctantly uninstalled it and restarted Windows. This¬†seemed to fix the issues with the browser hanging but Word still wouldn’t open documents so I tried doing a Repair of the installation of Microsoft Office 2010 Professional to see if this would fix the issues with Word. After completing the repair and restarting things seemed to be ok and I was able to work on a document review for a few hours last night.

BUT, when I logged in this morning and opened up a Word document I was immediately hit with the problem again. DOH!!!

As a last resort I reverted to the restore point prior to the installation of the IE Developer Toolbar and restarted Windows. This seems to have worked and I have been able to work on various Word documents and in IE without problems since. In my books this confirms without a doubt that the installation of the IE Developer Toolbar on my system was the cause of all these problems. From now on I’ll limit its use to my development server¬†VM’s where I haven’t encountered this problem before.

Leave a comment

Filed under General SharePoint Development, Microsoft Office Sharepoint Server 2007, SharePoint 2010

User property of SPAlert object not set

I have been working on a mechanism to notify users of changes to lists. Why not use the OOTB Alerts feature I heard you ask? this notification is meant to be an alternative to receiving e-Mail alerts and both methods would be available to users.

Anyway I’ve built the basis of the solution around the concept of using a custom built alert handler and templates as described on the SharePoint Team Blog and leveraging the example provided in the SPAlertPipeline project in CodePlex. It all works nicely until I attempt to determine the user that the alert I’m processing has been sent to. For the alternative notification I’m interested in the login of the user not the email address and the User property on the SPAlert object passed to the handler should be able to provide it e.g.

public class AlertHandler:IAlertNotifyHandler
    public bool OnNotification(SPAlertHandlerParams ahp)
             SPUser alertUser = ahp.alert.User;

Instead when this line is hit I receive a null reference exception! There is little or no information around that others have hit this problem and the MSDN documentation continues to indicate that it is available and works.

The only work around I currently have requires a couple more lines of code but at least provides me with the information I’m looking for. Here it is…

SPSite site = new SPSite(ahp.siteUrl + ahp.webUrl);
SPWeb web = site.OpenWeb();
SPUser alertUser = web.AllUsers.GetByID(ahp.alert.UserId);

Leave a comment

Filed under Microsoft Office Sharepoint Server 2007

Baffling Error in VS2008 with VSeWSS

A colleague and I were both encountering a baffling error today when trying to use VSeWSS 1.3CTP features (such as WSP View or Deploy) within Visual Studio 2008 on a newly built VM running Windows Server 2008 and MOSS 2007 Enterprise Edition.  Neither of us had encountered this problem running VSeWSS 1.3CTP under Windows Server 2003.

The error we were receiving was..

Error 1
Error parsing Solution. Error: System.ServiceModel.ProtocolException
The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: ‘<html>
        <title>Object reference not set to an instance of an object.</title>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Lucida Console";font-size: .9em}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
    <body bgcolor="white">
¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† <span><H1>Server Error in ‘/’ Application.<hr width=100% size=1 color=silver></H1>
¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† <h2> <i’.

Log file written to: C:\Users\developer\AppData\Roaming\Microsoft\VSeWSS 1.3\VSeWSS1.3.log  0 0 

Hitting Google and Bing found nothing helpful nor was there anything related in MSDN or TechNet. With a little more digging I think it is caused by a problem in the .NET Framework installation or possibly the VSeWSS 1.3 CTP installation (can be sure which though). To fix the problem you need to register the script maps for WCF under .NET 3.0 as it seems WCF is used by VSeWSS to communicate with its special web application. For some reason I can’t understand it was done in the server 2003 install but not in 2008. Script maps can be registered using the ServiceModelReg.exe utility under the .NET 3.0 framework folder ( I ran with the -i option and it fixed the problem.

Leave a comment

Filed under Microsoft Office Sharepoint Server 2007