Skip to main content

Posts

ACTIVATING THE TAXONOMY FEATURE

Suprisingly, the Taxonomy feature is hidden in SharePoint 2010 and is not viewable in the user interface. In other to activate the feature > Fire your SharePoint PowerShell > Type the command Enable-SPFeature -id "73EF14B1-13A9-416b-A9B5-ECECA2B0604C" -url thesiteurl I hope this will save somebody few minutes of searching... QED

HOW TO CREATE SPFieldLookup programmatically

This is a nice snippet I saw and will like to share Let us assume we have two list aList and bList already created. Requirement is to create a lookup column in aList which will look up values in bList. SPList aList = web.Lists["aList"]; SPList bList = web.Lists["bList"]; aList.Fields.AddLookup("Lookup", bList.ID, false); SPFieldLookup fldLookup = aList.Fields["Lookup"] as SPFieldLookup; fldLookup.LookupField = bList.Fields[SPBuiltInFieldId.Title].InternalName; fldLookup.Update();

ERROR DISPLAY SHAREPOINT

By default, the SharePoint web config only displays vague custom error which for a developer usually does not provide any meaning. To enable clear error display, do the following: Open the web config for editing, this is located inside the wwwroot. Make sure you select the right port number. The default post is 80. Find the "CallStack" attribute in the SafeMode section, change the value from false to true. Identify the "CustomErrors" in System.Web section, change the value from On to Off. Please note that this would be unnecessary in a production environment and it is only suitable in a test environment.

ERROR LOG IN SHAREPOINT

Nice little snippet to log errors using the object model and mininal code: try { } catch (Exception ex) { Microsoft.Office.Server.Diagnostics.PortalLog.LogString("Exception occurred while loading form: {0} || {1}", ex.Message, ex.StackTrace); } Merry Christmas

Customizing Alert Notifications and Alert Templates in WSS 3.0

Alerts are an e-mail subscription notification service in WSS 3.0. Users can create alerts to be notified of changes to list items (item level alert), documents, lists (list level alert), or document libraries. Alerts in Windows SharePoint Services 3.0 are quite flexible; when you create an alert you have options such as when to be notified and what kind of changes will trigger the alert. Alerts can be managed by users and administrators and customized by developers. After an alert has been created, changes that fit the criteria specified in the alert are recorded in an event log. Alerts are generated by a timer job that reads the event log, formats the alert email using an alert template, and then sends that email out to the user. Alert templates are stored in Alerttemplates.xml. Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS Alerttemplates.xml defines the format, contents, and properties used to create alert messages from each list type in Windo...