Monday, June 9, 2008

A duplicate name "Item" was found

While creating a new site collection I encountered this error

"A duplicate name "Item" was found".

When I looked at the SharePoint Logs, they looked like

Creating top level site at http://xxxxx/sites/pub
Creating site: URL "/sites/pub"
Recalc needs to happen. Real = 0, Cached =-1, WFE = -1
Activating site-scoped features for template "global" at URL "http://xxxxx/sites/pub"
.
.
.
.
.
Failed to find the parent content type ID="ct-1033-0x010801c88a06ea0bfc4da991e96ef7d1d44f" for content type ID="ct-1033-0x010801c88a06ea0bfc4da991e96ef7d1d44f24"

The last line is the culprit! Few days back I was having problem creating a new content type where it says Failed to find the parent content type ID. Though I could resolve that problem at that time I forgot to uninstall the feature with invalid content type id. Now that feature is causing problem when I try to create a new site collection.

To resolve this just uninstall the feature that was causing the problem. You can look the logs to find the feature (or feature id) that's causing the problem.

Wednesday, June 4, 2008

How to Bind SendEmail Activity Properties Dynamically from code

You can do this by binding properties at design time to To, Subject, CC, BCC, Body. If you don't know how to bind properties, look at the following screenshots

This is how your properties windows of SendEmail activity looks like

Click on the button against To property (or the property that you want to bind) and the following Bind window will come up, go to the second tab, either choose Create Field or Create Property option.


Now assign the value to the newly created property in your code.