Monday, September 28, 2009

Busted! Importing Profiles from multiple organisational units in Active Directory

One big drawback of the way AD implements LDAP is the lack of support for querying on Organisaitonal Units. No matter what you try, you will hit a brick wall when trying something like OU=SharePoint or OU:SharePoint in a simple query. Even trying to access the value as a property of an AD object will fail as OUs are not stored as properties on objects but only form part of the hierarchy and not part of the metadata. So, when importing profiles into SharePoint, the only place where you can enter an OU is when you are selecting the datasource, before applying any filters. Which means only one single OU, right? Wrong. read the solution at SharePoint Mythbuster.com

Thursday, September 24, 2009

Busted: Customising the application.master

There are numerous articles out there about how to change the system master page. The one that all pages in the _layouts aka LAYOUTS folder use. In most cases they want to do this to enable a different datasource for the top navigation aka global navigation. The average rookie who is in charge of creating a site in MOSS using the publishing feature will stumble across this problem and start hacking away at either the original application.master, or even go and implement a custom http handler to exchange the application.master with a custom one on the fly. None of these approaches are best practice nor are they supported by MS. So is it impossible to fix without breaking the system? Not at all.
I've published a solution to www.sharepointmythbuster.com! It will allow you to replace the top navigation on the fly for all pages in the site collection, including those horrid system pages and application pages.

Wednesday, September 16, 2009

Gettting Started with SharePoint development

Microsoft put together ten labs for Developing on SharePoint and also provided a fully functional VPC for you to get started. Time for the image is running out, as it will expire on 30/09/09. So if you don't have your own SharePoint development environment and wish to have a look at what all the hype is about go and download the image quick

VPC Image:
http://www.microsoft.com/downloads/details.aspx?FamilyID=1beeac6f-2ea1-4769-9948-74a74bd604fa&DisplayLang=en

WSS Hands on Labs:
http://www.microsoft.com/downloads/details.aspx?familyid=B885DCE8-C93F-48AA-B798-4422FEBCC200&displaylang=en

Loads of Resources, Demos, and online Walkthroughs
http://www.microsoft.com/click/SharePointDeveloper/

Thursday, September 10, 2009

SharePoint Event Troubleshooting Tips

Gary from Combined-Knowledge pointed out this useful post in the WSS SDK today.
http://msdn.microsoft.com/en-us/library/aa979520.aspx
It is a great little list of issues you will come across when working with Event Receivers in SharePoint. You're bound to have come across the one or other weird behaviour when implementing events. You're not alone. The above list mentions a dozen common issues to be careful of.

How to Pre populate Form Fields in SharePoint

Can't do it better than the boys over at Endusersharepoint. A great JQuery script which works universally with all kinds of Field types including lookups and date time fields.
Just plonk this onto your EditForm or the page with your Dataview and off you go.
Sadly there are no delegate controls on the built in EditForm.aspx for you to override automatically so you will have to either customise the editforms or build your own for your cusotm content type or cusotm lists definition.

http://www.endusersharepoint.com/2009/04/20/jquery-for-everyone-pre-populate-form-fields/

Monday, August 24, 2009

SharePoint Server Limits

Often I get asked in classes what the limits are for SharePoint. Like how many files can I have in a document library and how many folders, how many lists in a site etc.
Microsoft published a really nice whitepaper on technet covering loads of limits, from how many user profiles per farm to how many items in a list.
http://technet.microsoft.com/en-us/library/cc262787.aspx

One thing to keep in mind though: IT IS ALL RELATIVE

Having 50000 items in a document might be quite feasible on the right farm, but if you're using your SQL Server for other stuff and he is running at max speed anyway (150+ Transactions per second for example) you will feel the pain faster than when he's got 4 quad cores, 20GB of Ram and is generally quite bored (10-50 Transactions per second)

Another good post I managed to scrouge of the internet is on the limit of columns in a list. The above article claims you can have up to 256 different field types in a list and up to 4000 columns. But can you? If you ever come across the column limit exceeded error message or your columns are not behaving the way they should (filtering not working properly for example) then you have reached the field type limit.
http://support.microsoft.com/?scid=kb%3Ben-us%3B823555&x=6&y=5%20http://support.microsoft.com/?scid=kb%3Ben-us%3B823555&x=6&y=5

These were the settings for WSS 2.0 and SPS 2003:

64 Single line of text and Choice (drop-down menu or radio buttons)
31 Multiple lines of text and Choice (check boxes (allow multiple sections))
32 Number and currency
32 Hyperlink
16 Date and time
16 Lookup
16 Yes/No
8 Calculated

in WSS 2.0 these limits were set and they were transferred to WSS 3.0 Although they are not enforced the same way no more and you can end up creating more than those in some cases, expect the system to start acting up and behaving badly when exceeding those limits.

Thursday, August 20, 2009

Edit only your own on document Libraries

This is another one of those features which people cry for. You have that option on Lists via the advanced settings but not on libraries. WTF?
Well, it has to do with the implementation of that feature. Which is pretty bad by the way. The edit only your own setting does not integrate into the permission model but is a final check before an item is saved. Thus it does not work well with items which can be saved without the use of an application page, like from within word directly.
There are some blogs out there suggesting reactivating the feature on libraries using some code and following functions
SPList.ReadSecurity http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.readsecurity.aspx
SPList.WriteSecurity http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.writesecurity.aspx

but that does not get around people saving directly from within office.
Thus the only way right now to achieve something proper and stable is to create an event handler catching the modified event which checks who the creator was and responds accordingly.