A public update for the Service Pack 2 expiration date issue is now available

Over on the SharePoint Team blog they have published details of an update that resolves the product expiration issue with SP2. A quick quote from their blog:

The update can be applied before or after Service Pack 2 installation.  If the update is applied prior to installing Service Pack 2 it will prevent the expiration date from being improperly activated during installation of Service Pack 2, if it is applied after Service Pack 2 it will remove the expiration date incorrectly set during installation of Service Pack 2.

Also they plan on releasing an updated SP2 package that doesn't exhibit this problem, time to update my slipstreamed install sources...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Remember that the XSLT select is case sensitive...

I was customising a people search result web part this week and couldn't figure out why the mobile phone field was not rendering in the results. I could see it was in the AD properties, was making it through user profile import and then helped it through to managed metadata in the search results, I even checked the raw XML for the search results which showed it there as well. So I was down to checking my XSLT, I had camel cased the name of the field in my select code, as is my habit with coding to make it easily readable, but the XSLT was looking to match the case returned by the search results which was all in lower case.

A quick crrection and refresh and they all appeared as they should. Another little puzzle solved...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Using [Today] or [Me] in SharePoint calculated columns

If you try this in the browser you will get a message alon the line of Calculated columns cannot contain volatile functions like Today and Me'. At this point you go D'Oh!

But.... you can !!!

Before creating your calculated column you will need to create a column called Today or Me (depending on the calculation you want to create). Once this has been created, SharePoint lets you use the [Today] or [Me] functions in the calculation.

This example shows how to create an age calculated column.

[code:c#]

1. In your SharePoint list, create a column, title = DOB, type = Date, format = date only.

2. Create a column, title = Today, type = text.

3. Create a column, title = Age, type = calculated, calculation = DATEDIF([DOB],[Today],"Y")

4. Delete the column titled 'Today'

Now add a new item to the list. Set the DOB date (to somewhere in the past!) and save. The Age should have now been correctly calculated in Years.

[/code]

Note that once you have deleted the Today or Me column, if you try to edit the calculation in the future, SharePoint will complain again. However, you can simply create another column (Today or Me), edit your calculation, then Delete teh today / Me column again.

Currently rated 4.5 by 2 people

  • Currently 4.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SharePoint User From ID

Finding a user object from a user id.

using (SPSite site = new SPSite("http://localhost/")){ 
    using (SPWeb web = site.AllWebs[0])  {     
    
SPUserCollection userCollect =  web.AllUsers;
     SPUser user = userCollect.GetByID(3);
 
   }
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Search AD by Email

This code snippet allows you to search Active Directory for a given email address and
returns you the coresponding user object.  

String email = testUser@dev.lan; 

DirectoryEntry LdapConnection = new DirectoryEntry(); 
DirectorySearcher search = new DirectorySearcher(LdapConnection); 
search.SearchScope = SearchScope.Subtree; search.Filter = "(proxyaddresses=smtp:" + email + ")"; 
SearchResult result = search.FindOne();  

if
(result != null)
  { 
DirectoryEntry deDirEnt = result.GetDirectoryEntry();
  
Console.WriteLine("Address Found");
 
DirectoryEntry d = deDirEnt.SchemaEntry;
 
}
  else  { 
Console.WriteLine("Address not found!");
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

 

Dilbert of the day