Sunday, March 8, 2009

MOSS Administration: How do you find out what version/edition of SharePoint you are running?

A. Introduction I have encountered a problem, where I needed to check the versions of SharePoint and content databases we were running and also which edition of features set (standard or enterprise) was enabled on the farm. After some googling and also support from my colleagues, I found a bunch of very useful articles and tips that I would like to share. B. How do you find out what edition of SharePoint features you are running?
  1. Browse the SharePoint Central Administration.
  2. Click the Operations tab.
  3. Under the Upgrade and Migration section, click Enable enterprise features.
  4. Once you open this window you will find 2 radio buttons.If enterprise is enabled, you will find it selected and the radio buttons control is dimmed. This is because you cannot downgrade to standard. If standard is enabled, you will find it selected and you can choose enterprise. This upgrade would require a license key.
C. How do you find out the version of SharePoint you are running?
  1. Open Control Panel -> Add and Remove Programs.
  2. Select Microsoft Office SharePoint Server 2007.
  3. Click the link Click here for support.
Note: This alrticle also contains the steps of checking the SharePoint version you are running against the database. D. Useful Links The following links contain mappings between SharePoint Versions and the coresponding Public Releases. Various posts on my daily findings with SharePoint 2003 and SharePoint 2007 How to find the level of SharePoint you are running SharePoint 2007 Versions

Wednesday, January 14, 2009

MOSS Configuration: How to view the real exception behind the displayed custom error page?

A. Overview For a SharePoint developer, the error message An unexpected error occurred is useless! A developer needs to get details about the error that has occurred, at least the exception's call stack. When installing MOSS, the default configuration is that the Call Stack is deactivated and the custom error pages are turned on. This is completely correct, because this is how you would wish to have it on your production system. Now comes the question: How should I -as a developer- change the default configuration on my development environment? B. Configure your development environment 1. Open the web.config file Path: C:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config 2. Turn on the call stack - Search for safemode element. - Change CallStack="false" to CallStack="true". 3. Turn off the custom error pages - Search for customerrors element. - Change mode="On" to mode="Off". 4. Enable debugging and batch compilation - Search for compilation element. - Change batch="false" debug="false" to batch="true" debug="true". C. Test your configuration - Browse the page that has previously thrown the "An unexpected error occurred" message. - You should now see the yellow ASP.NET page with the true exception and underlying call stack.

Friday, January 2, 2009

SPD Workflow: How to create a formatted body for the Send Email task?

A. Overview

The Send Email is a very popular action for SPD workflow developers. Unfortunately, the Editor of the e-mail body doesn't contain any formatting tools. That's a lot of luxury to ask for. But as the need arises, I have written this article to provide the steps for creating formatted e-mail bodies in the Send Email action.

I have taken the idea and some of the content of this article from an Office Online video tutorial with the title Watch this: Design a document review workflow solution.


B. Design the HTML needed in the body

1. Open Microsoft Office SharePoint Designer 2007.
2. Click File > New > HTML, in order to create a new HTML page.
3. A new panel opens. In the bottom left corner of this panel, make sure that the Split View is selected, as shown in the following figure.


IMPORTANT NOTE:
There are two considerations when you use HTML in workflows:

Consideration 1:
Workflow e-mails do not support class-based styles. All the formatting must be done using inline styles.
The following configuration steps should be performed:
- Click the Style Application icon on the bottom bar.
- Make sure that Style Application is set to Manual and the Target Rule is set to New Inline Style.


Consideration 2:
Any white space will affect how the designed HTML will be displayed. Therefore, it is recommended to remove it.
This can be done easily by performing these steps:
- Click Tools > Optimize HTML.
- In the Remove Whitespace section, select HTML all whitespace.


- Click OK. You can see that all the whitespace has been removed from the HTML code in the Code Pane.

To get the formatted text again, you should follow these steps:
- Select the text in the Code Pane and right-click it.
- Click Reformat HTML.


Now let's continue designing our HTML for the e-mail body.
5. Delete the default text in the Code Pane.
6. Copy and Paste the following text as an example in the Code Pane.



7. Click anywhere in the Design Pane, in order to see how your mail body would look like.
8. Perform the changes you wish.
9. Now remove the whitespace as explained in the previous Note section.
10. Copy your HTML code to a text file and save it, in order to be used later in the workflow.


C. Create the workflow

1. Click File > Open Site.
2. Enter the URL of the site containing an announcement list, on which we shall perform our test.
3. Now click File > New > Workflow.
4. On the Define your new workflow page, enter the following data:
  • Name: FormattingMails
  • Attachment List: Announcements
  • Start Options: Automatically start this workflow when a new item is created
5. Click Next, in order to start designing the workflow steps.
6. Enter Send formatted Mail Body as the Step Name.
7. In the Actions section, select the action Send an Email.
8. Click the this message link.
9. Fill the To and Subject fields with appropriate values.
10. Paste the HTML code which was designed in section B into the Body area.
11. Repalce the fields marked by [*****LOOKUP******] with the correct values using the Lookup wizard.


12. Click OK to close the message builder.
13. Click Finish to save and publish the workflow.


D. Test the solution

1. Browse the site containing the annoucenemnts list to which the workflow was attached.
2. Open the Annoucements list.
3. Create a new entry.
4. Check the body of the sent e-mail notification.

MOSS Configuration: How to display announcements on the home page of a Publishing Portal?

A. Overview Recently, I have encountered the question of how to add an announcements web part on the home page of a Publishing Portal. The same question arises for Calendar, Contacts, Discussion Board, Survey and a set of other lists, which belong to the so-called Team Collaboration Lists. As the title conveys, in this article I shall provide the steps for adding an announcements web part on the Home Page of a Publishing Portal. The exact same steps should be applied for displaying any other Team Collaboration List. In the last section of the article, I provide a note about how to accomplish the same task on a Collaboration Portal B. Create an Announcements list B.1. Steps for creating an Annoucements List: 1. Browse the Home Page of the Publishing Portal. 2. Go to Site Actions > Site Settings > Modify All Site Settings. 4. Under Site Administration, click Site Libraries and lists. 5. Click Create new content. PROBLEM: You would not find the Announcements list, as shown in the following figure. The reason for this problem is that the Team Collaboration Lists Feature is not activated by default on a Publishing Portal. The next section would show you how to activite this feature. B.2. Steps for activating the Team Collaboration Lists Feature 1. Go to Site Actions > Site Settings > Modify All Site Settings. 2. Under Site Administration, click Site features. 3. Activate the Team Collaboration Lists. 4. Now repeat the steps for creating an Annoucenemts list which are described in section B.1. and you would find the Announcements under the Communications section, as shown in the following figure. C. Add the Announcements on the Home Page With section B finished successfully, the new announcements list has been added as content to the portal site. Now we would add a web part to view the content of the announcements on the Home Page. This can be accomplished by performing these steps: 1. Browse the Home Page of the Publishing Portal. 2. Go to Site Actions > Edit Page. 3. From the Page menu, select Add Web Parts and click Browse. 4. Click the Filter icon in the Add Web Parts pane. 5. Select Lists from the Show drop down list. 6. Select the announcements list created in section B. 7. Click the Add button. D. What about Collaboration Portals In a Collabortaion Portal, the Team Collaboration Lists Feature is activated by default. Thus, you can follow the same steps described in section B.1. for creating a new announcements list, without having to activate the feature first (as described in section B.2.). Finally, you would add the announcements web part on the Home Page by following the same steps described in section C.

SPD Workflow: A workflow does not start automatically

A. Overview Last week, a colleague of mine has encountered a problem with workflows authored in SharePoint Designer. When a workflow is configured to start automatically when a new item is created or changed, the workflow does not start as expected and the log file does not contain any error messages. However, if you start the workflow manually, everything works just fine. Afer some analysis and search, the problem was resolved. The following sections contain details about the source of the problem and all the symptoms, the cause of that problem and finally the fix. This information is taken from an article on Microsoft's Help and Support site. B. Symptoms After you install Windows SharePoint Services 3.0 Service Pack 1 (SP1), a declarative workflow does not start automatically in the following products:
  • Windows SharePoint Services 3.0
  • Microsoft Office SharePoint Server 2007
  • Microsoft Office SharePoint Designer 2007
For example, if you configure a declarative workflow to start when a new item is created or when a new item is changed, the declarative workflow does not start as expected. The Unified Logging Service (ULS) log files contain no information about why this behavior occurs. C. Cause This behavior occurs because a security fix in Windows SharePoint Services 3.0 SP1 prevents declarative workflows from starting automatically under the system account. After you install Windows SharePoint Services 3.0 SP1, declarative workflows do not start automatically if the following conditions are true:
  • The Windows SharePoint Services Web application runs under a user's domain account.
  • The user logs in by using this domain account.
  • The site displays the user name as System Account.
D. Resolution To resolve this behavior, set the application pool account to use a different user account. You may want to create a new user account specifically for this purpose. To set the application pool account to use a different user account, follow these steps:
  1. On the server that is running one of the products that is listed in the "Applies to" section, click Start, point to All Programs, point to Microsoft Office Server, and then click SharePoint 3.0 Central Administration.
  2. Click the Operations tab.
  3. Under Security Configuration, click Service Accounts.
  4. Click Web application pool, and then click Windows SharePoint Services Web Application in the Web service box.
  5. In the Application pool box, click the application pool that you want to change.
  6. Under Select an account for this component, click Configurable, and then type the user name and the password for the different user account.
Note that the fix applies to:
  • Microsoft Windows SharePoint Services 3.0
  • Microsoft Office SharePoint Designer 2007
  • Microsoft Office SharePoint Server 2007

Saturday, December 20, 2008

SPD Workflow: The changes performed in the workflow are not reflected on the site

A. Introduction: I have recently encountered a very weird problem while working with SPD workflows:
  • Open the workflow's XOML file.
  • Perform some changes to the workflow steps.
  • Click the Finish button, in order to save the changes.
  • Although the changes are saved successfully, the next time the workflow is triggered the old version of the workflow is run. In other words, the changes done to the workflow are not refelected on the site.
B. Unsuccessful Trials: Trial 1:
  • Restart SharePoint Designer.
  • Open the workflow, perform any simple change (e.g. Log To History List) and click Finish.
  • Trigger the workflow -> Changes are not refelected.
Trial 2:
  • Close SharePoint Designer.
  • Open the workflow settings of the list to which the worklfow is attached.
  • Remove all the workflow instances attached to the list.
  • Open SharePoint Designer.
  • Open the workflow, perform any simple change (e.g. Log To History List) and click Finish.
  • Trigger the workflow -> Changes are not refelected.
C. Solutions: This section provides two solutions of the described problem. One of them is how my team has fixed the problem and the other is taken from a colleague of mine who has coincidentally heard about our problem and told us that he has encountered it once and how he has fixed it then. Solution 1:
  • Close SharePoint Designer.
  • Open the workflow settings of the list to which the worklfow is attached.
  • Remove all the previous versions of the workflow instances attached to the list. (Cleanup step)
  • Save the list as a template. NOTE: Select the Include Content checkbox.
  • Delete the list to which the workflow is attached.
  • Create a new list using the saved list template.
  • Open SharePoint Designer.
  • Open the workflow, perform any simple change (e.g. Log To History List) and click Finish.
  • Trigger the workflow -> The changes are refelected correctly.
Solution 2:
  • Close SharePoint Designer.
  • Open the workflow settings of the list to which the worklfow is attached.
  • Remove all the the workflow instances attached to the list, including the current version.
  • Open SharePoint Designer.
  • Create a new workflow on the same list and add any simple condition and any simple action to it.
  • Click Finish, in order to save and publish the new workflow. Note that the new workflow has the files [workflow name].xoml and [workflow name].xoml.rules.
  • Using Notepad, copy the content of the old "xoml" file into the new "xoml" file.
  • Using Notepad, copy the content of the old "xoml.rules" file into the new "xoml.rules" file.
  • Open the new worklfow and quickly go through all the conditions and actions, to make sure that no variables are corrupt. Note: In case you use a Collect Data From User action in your workflow, I recommend that you create a new action and remove the old one.
  • Click Finish, in order to save and publish the new workflow.
  • In case the new workflow is saved properly, delete the old workflow in SPD. This can be done by right-clicking the workflow's name under the Worklfows node, selecting Delete and confriming the deletion when the warning message appears.
  • Finally, trigger the workflow -> The changes are refelected correctly.
D. Source of the problem: There is still a question lying there unanswered, namely What is the cause of this weird SPD behavior? Although the previous section provided a fix, but the more important issue is: How can we avoid this annoying problem in the future? Currently, I do not have the answers to these questions. As soon as I do, I would update the article. Meanwhile, any contributions would be highly appreciated.

Wednesday, December 17, 2008

SPD Workflow: How to deploy an SPD workflow to another site?

A. Introduction SharePoint Designer provides a very simple workflow editing tool. Workflows authored in SPD can be developed very quickly. However, this ease of use come with a cost: SPD workflows cannot be reused from one list to another or one site to another. Well, the truth is, you can re-use your workflows on multiple lists by making a few careful modifications to your workflow files that exist within SPD. Nevertheless, this method is not recommended nor supported by Microsoft. B. Migration Steps For accomplishing this task, you have to manually perform changes in the XOML file(s). The following articles provide step-by-step guides: Re-using SharePoint Designer workflows in multiple lists: http://www.sharepointblogs.com/tbone/archive/2007/11/20/re-using-sharepoint-designer-workflows-in-multiple-lists.aspx Re-parenting a SharePoint Designer workflow to a different list: http://www.sharepointblogs.com/andynoon/archive/2007/09/18/reparenting-a-workflow-to-a-different-list.aspx Applying a SharePoint Designer Workflow to multiple Lists: http://nickgrattan.wordpress.com/2007/10/17/applying-a-sharepoint-designer-workflow-to-multiple-lists/ Porting SharePoint Designer Workflows to Visual Studio: http://blogs.msdn.com/sharepointdesigner/archive/2007/07/06/porting-sharepoint-designer-workflows-to-visual-studio.aspx