SCSM 2012: Fixing the ID ‘DelegateControl1′ error in the Self-Service Portal

Recently we began experimenting with the deployment of the Service Manager 2012 Self-Service Portal SharePoint solution to an existing SharePoint 2010 farm. Anton Gritsenko and Travis Wright have written great blogposts on that. But while carrying on with the scenario we ran into an error applying the Service Manager masterpage. Fortunately I remembered this error from the Technet Forums.

Issue – The ID ‘DelegateControl1′ is already used by another control

Symptoms
This problem occurs when you apply the SMPortalPage.master to a SharePoint site. When you apply it you get a SharePoint 2010 Error message. This message is The ID ‘DelegateControl1′ is already used by another control.

Steps to reproduce
1. Follow the instructions in Anton his blogpost, I deployed them to a new Webapplication with a blank site collection (sts#1 template)
2. Activate the Site Collection feature SharePoint Server Publishing Infrastructure. Btw, in a production environment I wouldn’t do this, because this has some impact on your SharePoint environment.
3. Activite the Site feature SharePoint Server Publishing
4. Go to Master Page in the Look and Feel section which should be available now after activating both features
5. Change both Site Master Page and System Master Page from v4.master to SMPortalPage.master

Cause
First we compared the masterpage we used with the masterpage from an existing Self-Service Portal and a default v4 masterpage. It looks like the solution which we found in the c:\inetpub\wwwroot\wss\VirtualDirectories is an old one. It has some wrong id’s in them. Hopefully more details on that later.

Applies to
Service Manager 2012 RC (version 7.5.1464.0)

Workaround
The workaround is to replace the wrong id’s from ContentPlaceHolders and Controls with the right ones. Below is a cheatsheet if you want to repair your existing masterpage. If you fixed it you can upload it in the masterpage gallery and publish and approve it. Another option is to download a copy from an existing working SCSM environment and upload that one.

Btw, credits for this workaround go to my colleague Sander who really helped me in fixing this.

Element
Action
Wrong ID
Right ID
ASP:ContentPlaceHolderReplaceContentPlaceHolder1PlaceHolderSearchArea

SCSM 2012: Self Service Portal Service default results per page customization

I really notice on the Technet Forums that the customization of the Self-Service Portal of System Center Service Manager 2012 is one of the hot topics. That’s why I wanted to share another quick tip on how to customize it to your likings. Last Wednesday Nichoff asked in this thread about if it was possible to adjust the number of requests in the My Request web part.

Settings.xml
Like in my previous article about Self-Service Portal customization the settings.xml file is the place you want to be. This file contains a lot of configuration options (setting keys) for the Self-Service Portal and can be found in the Inetpub of your SharePoint server.

Solution
1. Go to C:\inetpub\wwwroot\System Center Service Manager Portal\ContentHost\Clientbin (or another location if your installation directory was different
2. Open the Settings.xml file
3. Modify the setting key for DefaultResultsPerPage with the value for the number of request you want to display per page. I adjusted it to 10:
DefaultResultsPerPage setting key
4. Don’t forget to restart your browser and clear your cache

Happy customizing!

Project Server 2010: Approval rules, delegates and task updates

Update 18-09-2012: This now has been fixed in the August 2012 Cumulative update.

Lately I have been working on more projects with Project Server 2010. Some time ago we came across a strange issue. After some investigation we were able to reproduce this on a clean environment without customizations. Maybe you also have this issue, so that’s why I thought it was good to share.

Issue – A task update created by a delegation session is not automatically approved by the rules engine

Symptoms
This problem occurs when you use rules in combination with a delegation session in PWA. It occurs when an approval manager, which has an approval rule for all request types, project and resources, starts a delegation sessions for a resource from his own project. When he submits actuals via a timesheet the task updates aren’t automatically approved by the rule engine.

Steps to reproduce

Preparation
First we created a project plan and a rule for the project manager. And after that we use an administrator to create a delegation session.

Project Manager
1. Log in as Pieter Project Manager
2. Create a new project from project center based on the template Basic Project Plan
3. Create a single task (auto scheduled) with 100h work from 2/1/2012 to 10/1/2012
4. Build Team and assign a Team member, in this case Ted Team Member
5. Assign the Ted Team Member as resource to the task and publish the project
6. Go to Approval Center > Manage Rules and create a new rule
7. This rule automatically runs an publish all updates. Also it applies to all request types and all of the projects and resources

Administrator
1. Log in as Aad Administrator
2. Go to Server Settings > Security > Manage delegates and create a new delegation session for Pieter project manager who is working on behalf of Ted Team Member

#Scenario 1 – Task Update automatically accepted
In this first scenario we check it the rule works and let the resource write actuals on the task.

Team member
1. Log in as Ted Team Member
2. Go to Settings > Manage Timesheets and create a new timesheet
3. Write 40 hours of actuals on the task and send the timesheet
4. Go to the status details page of the task and see that his update is automatically accepted by the rules engine

#Scenario 2 – Delegation Task Update pending
In this second scenario we check if the rule works for a delegation session

Project Manager
1. Log in as Pieter Project Manager
2. Go to Personal Settings > Act as Delegate
3. Start Delegate Session
4. Go to Settings > Manage Timesheets and create a new timesheet
5. Write 40 hours of actuals on the task and send the timesheet
6. Stop Delegate Session
7. Go to Approval Center and see that there is a task update pending and not automatically accepted by the rules engine

#Scenario 3 (in combination with Scenario 2) – Task Update merged and automatically accepted
In this third scenario we check what happens after a delegation session.

Team member
1. Log in as Ted Team Member
2. Go to Settings > Manage Timesheets and create a new timesheet
3. Write 40 hours of actuals on the task and send the timesheet
4. Go to the status details page of the task and see that the pending update from the delegation and his update is merged into one task update and automatically accepted by the rules engine

Applies to
Project Server 2010 – Build 14.0.6614.500

Workaround
The workaround is pretty simple, just let the Project Manager manually accept the task update. In our case this wasn’t a very good workaround because a lot of approval managers were using this rule.

Solution
We are still in the process of finding a solution a filed this as a case with Microsoft.

This now has been fixed in the August 2012 Cumulative update. It is described in kb 2687390 as:
When you start a delegation session as a delegate in Project Server 2010, auto-approval rules for task updates do not work as expected.

SCSM 2012: Self Service Portal Service category color customization

Lately I’ve been wandering a bit more on the Technet Forums, this has been pretty useful. Friday I came across this thread from Bart Timmermans about customization in the Self Service Portal of the product System Center Service Manager 2012. He asked if it was possible to adjust the styling of Service category headers. Of course I accepted the challenge.

Analysis
The Self Service Portal is a solution on SharePoint 2010 which deploys some web parts. Like Travis Wright described in his latest Self Service Portal blogpost those web parts use Silverlight .xap files. After some .NET Reflector work on the Portal.BasicResources DLL. I found that a lot of the color styling for the portal is being done by using brushes.

Brushes
A brush is an Silverlight object which can be used to paint for example solid colors or linear gradient. In that DLL I found a .xaml file which defined some solidcolorbrushes and they had a key. In Silverlight they use a 8 digit notation for the color, this is a RGBA value.

Settings.xml
The Self Service Portal actually has a settings.xml file which can be used to define some basic settings. I noticed it also had some setting keys for colors. This triggered me to add a key for one of the brushes, ExpanderHeaderBgBrush. My attempt worked. After adjusting the Settings.xml and clearing my browsers cache I saw a new green color!

Service Category background color

Solution
1. Go to C:\inetpub\wwwroot\System Center Service Manager Portal\ContentHost\Clientbin (or another location if your installation directory was different
2. Open the Settings.xml file
3. Add a setting key for ExpanderHeaderBgBrush with your desired RGBA color:
ExpanderHeaderBgBrush setting key

Happy customizing!

Microsoft Dynamics CRM 4.0 errorcodes–Troubleshooting

A big part of my work is in the Incident management field. One of the products I work a lot with is Microsoft Dynamics CRM 4.0. The objective of this post is to give some quick tips and pointers on how to troubleshoot those incidents.

Security Roles
First thing is the ability of reproduction on the CRM environment. Does the same user have the issue in a certain situation. The user context plays a big role in that. From which business unit is the user part of. And what kind of security roles and the access levels on the different privileges always does he or she have? The Microsoft Dynamics CRM 4.0 priviliges by entity Technet article is a good resource.

Tracing
If I can reproduce the incident my next step is always taking a peak in tracing. Of course you should have tracing enabled at that point, in Microsoft knowledge base article 907490 you can find an explanation on how to enable it.

Error codes
There are lots of Error codes, 1359 to be exactly. A complete Microsoft Dynamics CRM 4.0 Error code list can be found on MSDN. You can also download it as an worksheet in the  Most common error code I have seen so far was the 0×80040220 – PrivilegeDenied – The user does not hold the necessary privileges. The user doesn’t have the right access level to complete the the operation. The only problem with Microsoft Dynamics CRM 4.0 is that they write it like that in the log.  

Crm Exception: Message: SecLib::CrmCheckPrivilege failed. Returned hr = -2147220960 on UserId: 2c3519fc-f322-df11-ada7-00155d961205 and PrivilegeId: 2DDDED47-7488-4039-B9FF-81DEFE81FDD3, ErrorCode: –2147220960

You notice three things in the exception:
User: 2c3519fc-f322-df11-ada7-00155d961205
PrivilegeId: 2DDDED47-7488-4039-B9FF-81DEFE81FDD3
ErrorCode: –2147220960

To figure out which user you are looking at in the error is easy. The user name is easy to get from the interface. Log on as and system administrator on your Microsoft Dynamics CRM 4.0 installation. Navigate to Settings > Administration > Users. Open a random user record, a dialog will open. Press F11, you will see a following kind of url: https://url/OrganizationName/biz/users/edit.aspx?id={RandomUserGuid}. Replace the RandomUserGuid with the GUID from the Crm Exception.

PrivilegeId can be a little bit more tricky. It depends if the privilege is from a custom entity or a standard entity. Standard entities can be found in the earlier mentioned Microsoft Dynamics CRM 4.0 priviliges by entity article on Technet. But if you don’t like clicking through you can use a free tool like Find Privilege from Mitch Milam.

For the conversion of the Error Code you can use the calculator on your desktop. Follow the instruction of David Jennaway in his CRM Error Codes blogpost. In the Software Development Kit you also have a Crmhelpers folder which contains the error codes, you can download the latest Microsoft Dynamics CRM 4.0 Software Development Kit on Microsoft Download Center.

Hopefully this will give you some inside on Microsoft Dynamics CRM 4.0 incident troubleshooting. In next version CRM 2011 they have made it a bit more administrator friendly, so more on that to come!

Security Exception

Gonna try and post some more troubleshooting articles, just like my colleague Michaël. This time an article about a problem in Microsoft Office SharePoint Server 2007.

The problem
A customer came across a security exception error. But it didn’t always show up. Turned out it only showed when she was routed to a certain Web Front End, WFE02. You can see the error below in a screenshot.
SecurityException

The cause
The application wanted to write an event in the event log of WFE02 but wasn’t able to because the event source doens’t exist. It also doesn’t have rights to create the event source. That is why it is throwing an exception.

The solution
Temporarely give the application pool account that is used as identity of the web application local administrator rights on the WFE02.

1. Find out what the application pool identity is from your SharePoint web application. Go to IIS manager in administrative tools or type the command inetmgr in the run box.
IISmanagerapplicationpoolidentity
2. Go to Server Manager in administrative tools. Open the Configuration tab and go to Local Users and Groups and go to the Administrators Group.
AddApplicationPoolIDtoLocalAdmins
3. IISreset the web front end by typing the command iisreset in the run box.
IISreset
4. Remove the application pool identity from the administrators group.

Now the event source can be created and the items will be posted in the event log. The customer will see the .aspx page again.

In this case it turned out to be that the application wanted to write information events in the event log. Can be really annoying if your application won’t run right because of some information logs.

Incident management: Creating an incident

Since a while I’ve been working with a new Microsoft product from the System Center family called Service Manager 2010. I’ve been putting a lot of time and effort in using it and I wanted to share this with you. So from now on I’m gonna write some blogposts about it. I’m gonna try to do this in a persona-scenario kind of way. But one step back, what the heck is Service Manager 2010 anyway? I can write a whole definition about it but Microsoft also has a clear one:

System Center Service Manager 2010
Microsoft System Center Service Manager is an integrated platform for automating and adapting your organization’s IT service management best practices, such as those found in Microsoft Operations Framework (MOF) and Information Technology Infrastructure Library (ITIL). It provides built-in processes for incident and problem resolution, change control, and asset lifecycle management. Through its configuration management database (CMDB) and process integration, Service Manager automatically connects knowledge and information from System Center Operations Manager, System Center Configuration Manager and Active Directory.

Source: Microsoft

First of all what I want to do is show you part of SCSM 2010 and what it does out of the box. My first focus will be on working with incidents in SCSM 2010. In SCSM 2010 they have delivered an incident management pack based on best practices like MOF and ITIL. A high level overview about incident management is written by Ketan Ghelani overhere.

I’m using the following personas and scenario for this. I have used the Microsoft Dynamics Customer model for this.

Personas
Lisa – Customer Service Representative
Charlie – Customer

Scenario #001 – Lisa creates an incident
Lisa gets a call from Charlie at the Helpdesk number. Charlie tells Lisa that he isn’t able to use his e-mail. This is already the second time this happened. Last time a colleague from Lisa helped him with that incident. Charlie also tells Lisa that he is away for the next few days and that he is only available via landline number +1 123 456 789

Like you see above, this is not the most interesting scenario. But it does give you a first idea of what kind of interface we are dealing with. So this is the main reason why I’m posting this, showing you the User experience of SCSM 2010.

Lisa executes the following steps in this scenario:
1. Log on to the SCSM 2010 console
2. Create an incident & fill in the details
3. Relate an older incident
4. Activate the incident & watch it in the incident overview

1. Log on to the SCSM 2010 console
This is of course the most basic step. I added this one to still give you an idea what you will experience when first opening the console.
Connect to Service Manager ServerLisa connects with her credentialsThis is the landing page after you log on. First look on the interface, very similar to other products in the System Center family like SCOM or SCCM

2. Create an incident & fill in the details
Most important part of this step is to view the interface. There are a few important parts in the interface of creating a work item, in this case an incident. You have a status part on top of your screen, tabs with information about your work item and a tasks pane on the right to do something with the work item.
Lisa is gonna add a new incident. This is a work item, click the work item menu bar, or wunderbar as they like to call itLisa selects the Incident Management folder. You see on the right a create incident option in the task paneIt is also possible to create an incident from within the folder, via a right mouse actionA form opens in which Lisa can fill in the incident details. This is the template for a standard incident delivered out of the box in the SCSM 2010 incident management pack. Notice a few areas like the status bar on top, task pane on right & the tabs
Lisa can fill in the affected user, this can be someone from an Active Directory imported with a connector or CSV or just created manuallyLisa can also use dropdown lists in a template, out of the box it is user for fields like category, source, etc.Lisa can also add the affected service, in this case probably an exchange accountAfter Lisa filled in all the information of the incident notice how the top bar is filled with information Incident number, Status, Affected user, Main contact info, Created on, Resolved by & Time worked

3. Relate an older incident
One of the features in this management pack and the product itself is that you can relate a lot of stuff to a work item. In this scenario I’m showing you how to relate another incident to this current incident.
The second tab is the activities tab, you can add activities which are related to this incident. This can be a custom one, or base on pre-defined templated. We are not gonna use this in this scenarioLisa adds a related work item, in this case Lisa adds the previous incident with user e-mail which was created for CharlieResolution tab, is primarily used by the persona who is gonna solve this case, so Lisa doesn't use this tab in this scenarioHistory tab, nice overview of what has happened with this work item. In this scenario we also not using it.

4. Activate the incident & watch it in the incident overview
Like I stated in one the previous screenshots SCSM 2010 is working with folders and views to show work items. I wanted to show the end result to also give you an overview of this interface.
If you now go to all incidents view you will see the new created incident by LisaThe my incidents view, which shows all the incidents of the current logged on user, in this case Lisa

So this is a quick overview of how to register a incident and in general a work item in System Center Service Manager 2010. If you have some questions or feedback feel free to comment in the section below. I will post some new scenarios soon.

Sources:
Microsoft Service Manager product page
High level overview incident management written by Ketan Ghelani on the Microsoft Service Manager 2010 team blog
Microsoft Dynamics Customer model poster
Microsoft Opeations Framework

Reference to ListTemplate ID’s MOSS

Lately I’m building different kind of features, which can be very easy and interesting, but more on that later on. When I tried to bind some of those features to different kind of lists I came across the subject of ListTemplate ID’s.

ListTemplate ID’s
Every ListTemplate is associated with a different kind of ID, a value which can be used within a feature. For instance, a announcements list template is associated with the value 104. This can be very useful if you want to bind your feature to just document libraries.





DeletingEventHandler
ItemDeleting
10000
DeletingEventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f5cce5f062aa189d
DeletingEventHandler.DeletingAction






The example above shows how to use a event receiver in your elements.xml file of a feature. In this case my event handler feature registers receiver for the ItemDeleting event of a Announcements list template. It uses my custom code described in the DeletingAction class (.cs).

Reference ListTemplate ID’s.
It can be useful to know the different kind of ListTemplate ID’s when you create features. When googling I came across some reference posts on ListTemplate ID’s. I decided to put them together into one table and added two Listtemplate ID’s I discovered myself. I found 1300 Translation Management library & 1301 Languages & Translations. For all the others ID’s the credits go to MSDN library, Mike Smith & Alex from Phase 2.

 
 
 

If there are any errors in the table above or you have new ID’s please let me know.

How to create & deploy a custom theme in MOSS?

About 3 years ago this was one of the first questions I got when I started my first internship. Back then I was working with Sharepoint Portal Server 2003 & WSS v2. Soon I discovered it wasn’t as easy as it looked, but I got the basic idea. Every modification was by hand, but has something changed since then?

Classic 2003 way to create a custom theme
Create a custom theme the ’2003 way’ was mainly copying, pasting & editing files on the sharepoint web server. Especially the editing of the theme stylesheet, which contains a enormous amount of elements & classes, was a hell of a job. Fortunately tools like Color cop & Internet Explorer developer toolbar made it a bit manageable. Also resources like Heather Solomon’s CSS reference guide were pretty useful.

The basic steps were:
1. Copy a existing theme on the MOSS web server
2. Renaming setup file (.inf)
3. Modifying the stylesheets, images
4. Adding the theme to the TEMPLATE\LAYOUTS\1033\SPTHEMES.XML file

If you are searching for howto’s I can recommend articles from: Sharepoint End User Content Team, Tigirry’s Sharepoint Blog & Dan Lewis

Creating a custom theme MOSS style
Since then a lot has changed in the world of Sharepoint. Cool things like solutions, timer jobs & features were introduced with the release of MOSS. But googling on “create custom theme moss” still gives the same result. Copying & editing theme files on the web server.

Has nothing really changed since then? No, some things have changed, thanks to the wonderfull MOSS community.

That is also the main reason of this post. Two days ago I came across a this post from Keith Dahlby from Solutionizing.net about his STSDev Theme solution generator. He wrote that he added this option to the codeplex project STSDEV. It automates all step 1,2 & 4 described in the 2003 way and adds it to a Visual Studio project. And instead of manually copying it to the web server it creates a solution!

Adding import technique to Theme solution project in VST
One of the drawbacks of this was that if you upgrade the theme solution you still had to re-apply it by hand to the sites that are already using it. In some scenario’s this can be a problem. At this point the @import technique described by Heather Solomon comes around the corner. Keith Dahlby was already talking about implementing this in his generator, so looking forward to it.

In the meantime I manually added the import technique to my Visual Studio project, this is how I did it.

1. Follow Keiths steps described in this post to develop a theme solution project with STSDEV found on Codeplex

2. Create a new folders in the ROOTFILES directory for your theme.css file, I use the LAYOUTS/1033/STYLES/ location, as described in Heather’s @import technique post.
How to create a custom theme in MOSS? #07

3. Copy your theme.css file from the THEMES folder in ROOTFILES into the newly created folder in step 2
How to create a custom theme in MOSS? #02

4. Edit the theme.css file in the THEMES folder by removing al styles and replacing it by the single line:

@import "/_layouts/1033/styles/ExpiscornovusTheme/theme.css";

How to create a custom theme in MOSS? #03

5. That’s it, if you build the project you get a solution file (.wsp). Next time you upgrade your theme solution you don’t have to re-apply the theme to every individual site that uses it, just press (ctrl + ) F5!

Customizing
Although this solution makes the creation and deployment of custom themes a lot easier it is still a good idea to think about customizing. Customizing a theme is still basicly editing a extensive CSS file. If you want it to look completely different from the basic MOSS look be aware this could be a hell of a job with all those elements. If you want to read more about theme customization I can recommend one resource in general: Heather Solomon’s blog. She has a lot of great articles on customizing, so definitely visit that blog.

Update 07-10-2008
Removed step 5 because the ddf & manifest files are modified during the rebuild process.