Friday, September 16, 2011

Usability in SharePoint

Nowadays, I believe developer teams are more and more used to the concept and importance of usability and design. Apple has clearly shown the way. Microsoft is adjusting to the new reality (i.e. Windows 8 Metro UI), but SharePoint still needs a lot of work.

Yes, I know, SharePoint is just a platform and can be built upon, which is great. But the out-of-the-box functionality should always provide not only a good, but a great experience for the user. Ribbon and having most actions asynchronous was just the first step. The overall usability needs a push.

I just finished reading a great article on EndUserSharePoint, Usability Issues in SharePoint 2010 My Sites: Social Design Patterns and Standards, by Marcy Kellar and Chris Poteet. Highly recommended!

Thursday, September 15, 2011

SharePoint Calendar with Outlook Reminders

This is a standard requirement, one that SharePoint does not fulfill out of the box.

All the people out there that are using calendars and relying on them for their daily schedule, know that reminders are a central option. Even those (like me) who use it frequently but do not depend on it on a daily basis, have that one task they have to do every month, when the Outlook reminder rings the bell.

So, telling users how great it is to have a common calendar in SharePoint and then telling them "No, there are no reminders, but you can copy-paste the event to your personal calendar" is a no-no. There are solutions, not all of them are pretty or easy as they should. The one I will present is my preferred one. Ultimately, you will have a SharePoint RSS feed exposed in Outlook with reminders whenever something pops up. And something also needs to be done to have that RSS feed being refreshed more than once an hour.

This solution came together from a lot of different sources of information, improvements and workarounds users found for each specific aspect they needed to solve in SharePoint. But no one actually set a complete guide and how-to, for something I believe is a very common requirement. So, that's what I will do, in 3 steps.

  1. Have a new field while adding a new event to the calendar, where users set their reminder date;
  2. Have Outlook popping reminders up, when that date is reached.

  • Step 1: Create the "Reminder date" field and the "Outlook reminders" view
  • Step 2: Configure the RSS feed in Outlook with reminders
  • Step 3: Getting a faster refresh on the RSS feed

Step 1: Create the "Reminder date" field and the "Outlook reminders" view

You should start by reading the first part of the great post by Paul Liebrand, it's in here. It shows how to create the field, add the view and get the RSS feed Url.

In my specific scenario, I made some changes:
  • The field is not calculated, it is user defined;
  • The view shows all the past reminders, not just the ones from today;
  • The view works with the time also, not just the date.
Follow these steps:
  • Create the field with type "Date and Time";
  • Change the view's filter from "is equal to" to "is less than or equal to";
  • Edit the view with SharePoint Designer to include the option "IncludeTimeValue" in the filter, as described by Nick Grattan, in here.

Step 2: Configure the RSS feed in Outlook with reminders

Add the feed and then configure a rule so that Outlook warns you when a new item arrives. Just follow the second part of Paul Liebrand's article, all in there, step by step.

Step 3: Getting a faster refresh on the RSS feed

Having reminders being refresh once an hour is not OK. So there is a solution for it, disabling the update limit and creating a new send/receive group with a custom schedule for the updates (5 minutes in my case). I got this information here. The first step, you can do it after adding the feed, by going to "Account Settings > RSS Feeds > Change".

There you go!

Wednesday, September 14, 2011

SharePoint 2010 Managed Metadata Columns problems


Managed Metadata Columns are a good addition to SharePoint, but the integration with the rest of the products and features is still very scarce. Multiple things may go wrong.

The project I'm working on had a column which would be better off with Managed Metadata, and not a Choice field. I've been searching and searching, drilling and drilling, and can't make it work correctly. I navigate through the term set but the value never gets saved. Can't really tell why.

But I did find many caveats while searching for information: it will not work with Workspace, InfoPath, Datasheet View, "Begins with" and "Contains" filters in Views and Calculated Fields. Also, they'll be hard to use in SharePoint Designer Workflows. And if your root site uses the Blank template, the hidden feature supporting this functionality will not be activated by default.

All the info here and here.

Tuesday, September 13, 2011

SharePoint 2010 Tip #5: editing the NewForm.aspx in a list

If you need to edit the NewForm.aspx in a list and open it in SharePoint Designer, in advanced mode, you will notice that the webpart where the item adding happens is not configurable. It just displays a sample of what you'll get rendered in the page.

The reason for this is the default webpart used here is from the type ListFormWebPart, whose behavior is to automatically render the fields and controls needed according to the list definition. No customization here.

You'll need to add the DataFormWebPart, where these fields and controls will be fetched directly into your aspx page and can be edited. To do it, just go to "Insert > SharePoint > Custom List Form..." and choose your list, content type and the action you want to perform (new, edit, display). The old webpart can be deleted.

Warning: new fields will not be added automatically to this webpart.

Monday, September 12, 2011

SharePoint 2010 Tip #4: "Columns that require data are not included" in Datasheet View

If you have this error and are absolutely sure you are filling every required field, then this may well be the reason. If you activate the option to manage content types in a list and then change the type of one of the columns in the Content Type from Required to Optional/Hidden, it will erroneously leave the list field as required.
You must go to the field definition in the list and set it correctly.

SharePoint 2010 Tip #3: Workflow not starting automatically

This one is a classic. If you are logged in with the System Account, among other things, workflows do not get started automatically with your actions, such as creating a new item or editing an existing one. You have to use a different account.

SharePoint 2010 Tip #2: The Managed Metadata Service or Connection is currently not available.

I had this problem in my development machine (Windows 7). This problem was in the Managed Metadata Service (which I was trying to configure at the time), but it may affect all the others too. The message I got was: "The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator."

The reason was using my AD account to install and run the services and application pools of SharePoint. Since this was a development environment, I did not make extra accounts for a fully fit farm configuration. Due to security restrictions, passwords in our AD need to be changed on a regular basis and that generated the error above. The account was having log in problems, since the password was not a new one. Re-configuring all the services and applications pools to use a different account or resetting the password solved it.

SharePoint 2010 Tip #1: "This control is currently disabled" in Central Administration

In the central administration, if you are logged with the administrator account, but still don't have access to most of the options that should be available (like creating a New Web Application, etc), don't forget to check if you are running Internet Explorer as Administrator.

Friday, September 9, 2011

Install SharePoint Language Packs in Windows 7

If you are developing directly in your machine, in a Windows 7 environment, and try installing a Language Pack, it will fail because of the default requirements (Windows Server 2008).

To make it work, you need to extract the package and the change a configuration file.
  1. Execute "ServerLanguagePack.exe /extract:<your_dir>"
  2. Open <your_dir>\Files\Setup\config.xml and add the directive "<Setting Id="AllowWindowsClientInstall" Value="True"/>"
That's it!
There is a post about this in MSDN, here.

Updating list items without changing the Modified field

In some situations, we want to programmatically update some fields in a list item without users knowing about it. The reasons may be varied; for instance, maybe you are only filling some control fields to record some action performed in a workflow and not editing the "true" metadata of your document/item.

The SharePoint Server API has 2 solutions for this, in our SPListItem object (MSDN quote):
  1. UpdateOverwriteVersion(): updates the current list item without creating another version of the item.
  2. SystemUpdate(): updates the database with changes made to the list item without changing the Modified or Modified By fields.When you call the SystemUpdate method, events are triggered and the modifications are reported in the Change and Audit logs, but alerts are not sent and properties are not demoted into documents.
In my scenario, I used UpdateOverwriteVersion(), since I was actually creating a way to copy discussions between lists and was setting the Author, Created and Editor explicitly. I just needed to avoid having the Modified dates getting messed up, and this method solved it.

From other information I could collect, SystemUpdate() may be very useful to use in custom workflow actions where the Update() would make the workflow call itself recursively.

Tuesday, September 6, 2011

Deploy external DLL's to SharePoint

With the 2010 version, things got so much easier, in terms of deployment. So this is just a reminder.

If you need to deploy some external DLL to the GAC or /bin folder, along with your solution, just go to your Package.package file and choose the "Advanced" tab to configure everything you need. Like the Safe Controls directives for the web.config.

Archive or Copy Discussions in a Workflow

In the project I am currently working on, I have a requirement about archiving a discussion in a SharePoint Workflow. Actually, it is more complicated than that, as some information is also registered in a different list and the administrator/responsible for the discussions will also need to validate whether the discussion got a positive or negative feedback (which will influence the outcome of the workflow).

The main challenge here was the complex structure that discussions lists have. Each discussion is a folder and each reply an item inside that folder, from the type Message. All I wanted was to move the discussion from the original list to other one, archiving it. Using the workflow action to delete the item works, but not copying. So I created a new SharePoint Designer Action, the "Copy Discussion" action.

The set of articles "Working with SharePoint’s Discussion Lists Programmatically", from Itay Shakury, were very useful. You can find them here. It explains how stuff work and gives you code samples on how to access and create discussions and replies. It is for the 2010 version of SharePoint. Spot on. This was exactly what I was looking for. I then made my own version of it, according to my needs and got my custom workflow action going.

There is also another solution for archiving a discussion, using SPExport/SPImport. I found a topic on TechNet about the subject, in here. In my case, I prefer to do it programmatically, as it makes more sense in a workflow, than working with exports and imports.