User Profile Sync

Sometimes, when trying to create an alert in SharePoint you receive the following error message:

You do not have an e-mail address.
Alert has been created successfully but you will not receive notifications until valid e-mail or mobile address has been provided in your profile

The obvious things to check here are the outgoing mail server settings in Central Administration.

It may be the case that you recently added an email address to the account in question, or after receiving the above error added an email address to the user’s profile in Central Administration.
Continue reading

Posted in Configuration, SharePoint | Tagged , , | 2 Comments

MVP SharePoint WebPart

There are many development patterns available and one that I like is Model-View-Presenter (MVP). With the MVP pattern, there are different variations that you can use. For example, there’s a variant called Passive View and another called Supervising Controller.

They all follow the principals of MVP but have subtle differences. The Passive View pattern is geared towards projects that are looking for a maximum amount of unit test coverage, including testing of the user interface. For this pattern the majority of code in the View component is moved to the Presenter. The view here has practically no behaviour of its own. For this pattern, the View knows next to nothing about the Model and instead exposes simple properties for all the information it wants to display.
Continue reading

Posted in .Net, SharePoint | Tagged , , | Leave a comment

DateRangesOverlap

When working with calendar items created with recurrence patterns, there’s no immediately obvious way through the object model to expose the individual recurrence items. If you create a calendar event with a daily recurrence pattern which generates 6 separate events, you’re only ever given one item when looking for it through code.

Using CAML, it’s easy to get all 6 items back as individual items through the use of the DateRangesOverlap element.

The structure of the DateRangesOverlap element looks like:

<DateRangesOverlap>
  <FieldRef Name='EventDate' />
  <FieldRef Name='EndDate' />
  <FieldRef Name='RecurrenceID' />
  <Value IncludeTimeValue=\"TRUE\" Type='DateTime'>
    <Now />
  </Value>
</DateRangesOverlap>

Continue reading

Posted in SharePoint | Tagged , | Leave a comment

My Development Configuration

Just wanting to share the utilities, custom scripts and applications that I use when developing for SharePoint.

Besides the obvious, Visual Studio, SharePoint Designer and InfoPath, the following is what I find makes developing and debugging that little bit easier.

Visual Studio

When using Visual Studio, I add a few custom menu items to the Tools menu, the following are my staples:

Custom Tools

First up, there’s a menu item for displaying the strong name key for the current assembly.:
Continue reading

Posted in General | Tagged | Leave a comment

Hide SharePoint Ribbon Items

To hide a menu item from the SharePoint ribbon add a custom action to a module in your Visual Studio SharePoint project:

<CustomAction
Id="CustomIdentifier.Ribbon.Documents.New.NewFolder.Hide"
Location="CommandUI.Ribbon" RegistrationType="ContentType" RegistrationId="0x">
  <CommandUIExtension>
    <CommandUIDefinitions>
      <CommandUIDefinition Location="Ribbon.Documents.New.NewFolder">
      </CommandUIDefinition>
    </CommandUIDefinitions>
  </CommandUIExtension>
</CustomAction>

The example above will hide the New Folder ribbon menu item for all document libraries.

Using a RegistrationType of ContentType and RegistrationId of 0x means it will be applied to all items.
Continue reading

Posted in SharePoint | Tagged , | 1 Comment