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

Sunday, December 14, 2008

SPD Workflow: What happens when I edit an item while the workflow is In Progress?

A. Introduction If one designs a workflow that should start either when an new item is created or whenever an item is changed, then a typical question that popps into one's mind is: What happens if a workflow is In Progress and the item on which the workflow is running gets changed? Possible answers are:
  • The Edit operation gets aborted till the workflow finishes.
  • The Edit operation triggers a new workflow instance that starts running immediately.
  • The Edit operation triggers a new workflow instance that waits in a queue till the first instance of the worklfow finishes.
  • The Edit operation does not trigger a new workflow instance.
Well, in this article I would like to illustrate the results of my experiments around this issue. B. Preparations Create a new list, which we would attach the workflow to. For this demo, I have created a custom list called Overlapping Workflows. C. Experiments C.1. Experiment 1: Create one workflow for Create and Edit events C.1.1 Prepare the workflow - Open Microsoft Office SharePoint Designer 2007. - Click File > Open Site. - Enter the URL of the site containing our custom list called Overlapping Workflows. - Now click File > New > Workflow. - On the Define your new workflow page, enter the following data:
  • Name: Check Overlapping Workflows
  • Attachment List: Overlapping Workflows
  • Start Options: Automatically start this workflow when a new item is created and Automatically start this workflow whenever an item is changed
- Click Next, in order to start designing the workflow steps. - Enter Add tracking logs as the Step Name. - In the Actions section, select the action Build Dynamic String. - Click dynamic string link and type the text Title before Pause is:. Now click the Add Lookup button. For the Source select Current Item and for the field select Title. Click to close the lookup window. Then click OKOK again, in order to close the String Builder window. - Click the Variable link and select Create a new variable. Type TitleBefore as the Name and select String as type and click OK. - Add the action Log to History List. - Click the this message link and click fx. For the Source select Workflow Data and for the field select Variable:TitleBefore. - Add the action Pause For Duration. - Change the duration to 5 minutes. - Add the action Build Dynamic String. - Click dynamic string link and type the text Title after Pause is:. Now click the Add Lookup button. For the Source select Current Item and for the field select Title. Click to close the lookup window. Then click OKOK again, in order to close the String Builder window. - Click the Variable link and select Create a new variable. Type TitleAfter as the Name and select String as type and click OK. - Add the action Log to History List. - Click the this message link and click fx. For the Source select Workflow Data and for the field select Variable:TitleAfter. - Click Finish, in order to save and publish the workflow. C.1.2 Test the workflow Steps: 1. Create a new item with title Title 1. 2. Edit the item, before the workflow instance completes by changing the title to Title 2. 3. After the workflow completes, edit the item again by changing the title to Title 3. 4. Now edit the item, before the new workflow instance completes by changing the title to Title 4. Observations: 1. Only one workflow instance is running on an item at a certain point in time. The Edit operation in step 2 does not start a new workflow instance. 2. After this workflow completes, the history looks as follows: 3. The Edit operation in step 3 triggers a new workflow instance. 4. After this workflow completes, the history looks as follows: C.1.3 Conclusions 1. If an instance of the workflow is running, no other instance gets created. 2. The workflow's action deal with the current values of the item. The actions cannot differentiate whether these values are the original ones that have trigged the workflow or not. C.2. Experiment 2: Create separate workflows for Create and Edit events C.2.1 Prepare the workflows I would not write this section into so much detail like C.1.1, because we will use the same actions as before but with different configurations. Hence, I will keep my description simple. - Create a first workflow with the following definition: * Name: On Create Workflow * Attachment List: Overlapping Workflows * Start Options: Automatically start this workflow when a new item is created - The only step of this workflow is exactly like the one described in section C.1.1. - Create a second workflow with the following definition: * Name: On Change Workflow * Attachment List: Overlapping Workflows * Start Options: Automatically start this workflow whenever an item is changed - The only step of this workflow is exactly like the one described in section C.1.1. C.2.2 Test the workflow Steps: 1. Create a new item with title Title 1. 2. Edit the item, before the workflow instance completes by changing the title to Title 2. Observations: 1. The Create operation in step 1 triggers the On Create Workflow. 2. The Edit operation in step 2 triggers the On Change Workflow, while the On Create Workflow is running. 3. After the On Create Workflow completes, the history looks as follows: 4. After the On Change Workflow completes, the history looks as follows: C.2.3 Conclusions 1. It is possible to run more than one workflow instance on an item, if these instances are not of the same workflow. 2. The workflow's action deal with the current values of the item. The actions cannot differentiate whether these values are the original ones that have trigged the workflow or not. D. Applications Well, in the previous section, I have just illustrated the results I have found out from my experiments. In other words, this is how it works out-of-the-box. Now comes the question of how to apply this to our workflow solutions. In this section, I would like to provide tips and suggestions of the FAQ in related topics. Question 1: When I create a workflow that starts when a new item is created OR whenever an item is changed. The actions performed in both situations are the same except for one step which should differ based on whether the processed item is a new one or just an updated one. How can one find out whether the workflow was triggered due to an item's change or a new item's creation? Answer 1: Check this article: http://samar-hossam-sharepoint-spot.blogspot.com/2008/11/moss-workflow-was-workflow-started-due.html Question 2: I have a workflow that starts when a new item is created OR whenever an item is changed. Whenever a workflow is running on an item, I would like to lock this item for further edits until the workflow finishes. Answer 2: You should write a custom activity which locks/unlocks an item. You should use this activity at the beginning of the workflow, in order to lock the item and use it again at the end of the workflow, in order to unlock it. Check the following custom SPD activity on CodePlex: Grant Permission on Item

Tuesday, December 2, 2008

MOSS Configuration: Configure outgoing e-mail settings

The following article describes the procedure to configure the outgoing e-mail settings for Office SharePoint Server: http://technet.microsoft.com/en-us/library/cc263462.aspx

Sunday, November 30, 2008

Workflows: Starting a workflow from a survey response

A. Problem Description I have encountered several questions on the MSDN forums which try to troubleshoot problems of running workflows on survey responses. The problem they describe is the following: - Whenever you add a new response to a survey, the attached workflow does not start. - Instead, the status of the workflow appears as Failed to Start. B. Feedback Well, starting a workflow from a survey response is not supported in Windows SharePoint Services 3.0. Although the Workflows option appears when you click the arrow next to a survey response, you cannot start a workflow from a survey response. Microsoft has confirmed that this is a problem in the following Microsoft products: - Microsoft Office SharePoint Server 2007 - Microsoft Windows SharePoint Services 3.0 - Microsoft Office SharePoint Online Click here, for more details about this problem. C. Further Information Check this blog article, for more information about this issue.

Thursday, November 27, 2008

SPD Workflow: How to send a reminder a few days before the start date of a calendar entry?

A. Introduction As the title conveys, in this article I would like to show how one can create a workflow (using SharePoint Designer), which sends notifications to a list of recipients 7 days before the start date of a calendar entry. B. Preparations Create a Calendar, which we would attach the workflow to. For this demo, I have created a Calendar called Team Meetings. C. Workflow - Open Microsoft Office SharePoint Designer 2007. - Click File > Open Site. - Enter the URL of the site containing our calendar called Team Meetings. - Now click File > New > Workflow. - On the Define your new workflow page, enter the following data: --- Name: ReminderForMeetings --- Attachment List: Team Meetings --- Start Options: Automatically start this workflow when a new item is created and Automatically start this workflow whenever an item is changed - Click Next, in order to start designing the workflow steps. - Enter Calculate the reminder date as the Step Name. - In the Actions section, select the action Add Time to Date. - Click the 0 link and type -7. - Click the minutes link and select days. - Click the date link and then click fx. For the source select Current Item and for the field select Start Time. - Click OK. - Click the output link and create a new variable called ReminderDate of type Date/Time. - Click OK. - Click Add workflow step in the right panel, in order to create another workflow step. - Enter Check whether a pause is needed as the Step Name. - In the Conditions section, select Compare any data source. - Click the value link, then click fx. For the source select Workflow Data and for the field select ReminderDate. - Click the equals link and select is greater than. - Click the value link. Click the ellipsis, select Current Date and click OK. - In the Actions section, select the action Pause Unit Date. - Click the this time link and click fx. For the source select Workflow Data and for the field select ReminderDate. - Click Add workflow step in the right panel, in order to create another workflow step. - Enter Send reminder as the Step Name. - In the Actions section, select the action Send an Email. - Click the this message link and configure the different e-mail settings. - Click Finish, in order to save and publish the workflow. D. Test the solution 1. Create a new calendar item, whose Start Date is less than 7 days. -- Check that the ReminderForMeetings workflow has completed successfully. -- Check that you receive a notification now. 2. Create a new calendar item, whose Start Date is greater than 7 days. -- Check that the ReminderForMeetings workflow has started successfully. -- Check that you receive a notification on the right date.

Tuesday, November 25, 2008

Workflows: Comparison of SharePoint Designer and Visual Studio for creating workflow solutions

SharePoint Designer and Visual Studio 2005 (or later) can be used to create workflow solutions for MOSS. In order to be able to choose which platform to use, one has to understand the differences between authoring workflows in SPD versus Visual Studio. In the following section, I have summed up all the comparison criteria, which I have read in different books/articles or ones that I have tried myself. 1. Authors: SPD: Designers can author solutions, not just developers. VS: Only developers can author solutions. 2. Types of Workflows: SPD: It is possible to author sequential workflows only. VS: It is possible to author state-machine as well as sequential workflows. 3. Site Content Types: SPD: Does not support site content types. VS: Site content types are supported. 4. Deployment: SPD: Workflows are attached to a single list and are data-bound to that list. VS: Workflows are authored as templates. Such a workflow can be packaged as a SharePoint feature and installed on multiple sites or lists. 5. Forms: SPD: ASP.NET forms are auto-generated and can be customized. VS: Designed forms (InfoPath or ASP.NET forms) 6. Extendibility: SPD: Reuse out-of-the-box or custom deployed activities. No code-behind, so tools are limited to what’s included. VS: Reuse out-of-the-box activities, as well as building your own activities Code-behind capabilities make it very flexible and powerful. 7. Debugging: SPD: No step-by-step debugging. VS: Step-by-step debugging is supported.

Friday, November 21, 2008

Custom Workflow Actions: Links to SPD custom workflow activities

Introduction This article acts as an indexer for referencing pages which describe how to develop, troubleshoot and deploy custom activity libraries to be used in SharePoint Designer. They also contain links to alreday existing custom activities provided by open source communities. Links Useful Sharepoint Designer Custom Workflow Activities This codeplex project takes aim at making it easier to create advanced workflows using Sharepoint Designer by providing a set of custom workflow activities. http://www.codeplex.com/SPDActivities Workflow Essentials The SharePoint Solutions team has released a beta version of Workflow Essentials, which provides you with a proven reliable, less expensive way to augment SharePoint Designer's workflow capabilities. Workflow Essentials is a suite of useful custom activities and conditions for the SharePoint Designer. It is compatible with both WSS v3.0 and MOSS 2007. But it is NOT FREE. Workflow Essentials pricing information will be forthcoming in the near future. http://sharepointsolutions.blogspot.com/2008/11/announcing-workflow-essentials-for.html User Profile Sharepoint Designer Activities 0.2.0 The "User Profile related SharePoint Designer Activities" is a solution package (.WSP file) that contains four SPD actions (workflow activities) for the SharePoint Designer workflows. This package is only for MOSS 2007 installations. It will not work on WSS 3.0 machines. The available actions are: (1)Get user title, (2)Find manager of the user, (3)Find display name of the user and (4)Find department of the user. http://edinkapic.blogspot.com/2008/05/user-profile-sharepoint-designer.html Adding Activities to SPD This article answers one of the most frequently asked questions: adding activities into the SPD workflow designer. It gives a quick summary, shows you an example and provides some tips and tricks to help solve common issues. http://blogs.msdn.com/sharepointdesigner/archive/2007/03/15/adding-activities-to-spd.aspx Multi Value Columns Solution #2 - Custom Activities in SPD The default Send an Email activity in SharePoint Designer can’t send e-mails to multiple recipients if those recipients exist inside of a multi-value column in a SharePoint list. This article describes a custom workflow activity that overcomes this issue. http://rapidapplicationdevelopment.blogspot.com/2007/04/multi-value-columns-solution-2-custom.html HOW TO: Create a custom Windows Workflow Activity and make it available in SharePoint Designer The default Send an Email activity in SharePoint Designer doesn't allow you to specify a from email address. This article describes a custom workflow activity that overcomes this issue. http://www.sharepointblogs.com/tbaginski/archive/2007/03/08/how-to-create-a-custom-windows-workflow-activity-and-make-it-available-in-sharepoint-designer.aspx Sending an email to a group with a SharePoint workflow Dave has encountered a problem when trying to send notifications to user groups using the default SPD Send an Email activity. This has led him to develop a custom activity. He finally has blogged about it in this article. http://davesquared.blogspot.com/2007/07/sending-email-to-group-with-sharepoint.html But Mark Deraeve left a comment about a much better solution for Dave's problem. It turned out that it is all about some missing group permissions. Check it here. http://www.dailycode.net/blog/post/Send-email-to-user-group-in-Sharepoint-Workflow.aspx Create Sharepoint Site By Template in Code - Workflow Custom Activity This post documents the steps for building a custom activity that creates a Sharepoint site by template. This post also talks about the steps needed in order to add this custom activity into the Sharepoint designer. http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/07/08/SharepointSiteByTemplate.aspx SPD Workflow activity : Copying a listItem accros a site This custom workflow activity for Sharepoint Designer can copy a list item accros a site and/or to a list that is not available during the creation of the workflow but will be when the workflow is executed (using workflow variables). http://glorix.blogspot.com/2007/03/spd-workflow-activity-copying-listitem.html SPD Workflow activity : Creating a document library This article describes a custom activity that creates a document library using two variables that a user should enter in SPD. These two variables are the url of the site and the title of the document library. http://glorix.blogspot.com/2007/03/spd-workflow-activity-creating-document.html Sharepoint Workflow Custom Activity for Active Directory & Deployment on Moss 2007 This article illustartes how to create your own custom workflow activities using Windows Workflow Foundation. http://www.c-sharpcorner.com/UploadFile/rifaqats/rifaqat01102008014938AM/rifaqat.aspx

SPD Workflow: Real-life business workflows developed with SharePoint Designer

Introduction This article acts as an indexer for referencing pages that provide step-by-step descriptions for developing SPD workflows that solve real-life business problems. Articles Use SharePoint Designer to Email Daily Task Reminders Companies often turn to some kind of automated reminder system to prod End Users into marking their tasks complete, thereby allowing those beautifuly orchestrated business processes to proceed as designed. This article describes how “Power” End Users and Developers alike can use SharePoint Designer to create an automated task reminder system based on SharePoint’s core workflow capability. http://sharepointmagazine.net/technical/development/the-dog-ate-my-task-use-sharepoint-designer-to-email-daily-task-reminders Task Escalation using Workflows Organizations sometimes need to have a system that automatically escalates overdue tasks to other people. This article illustrates how to achieve this business target using a SharePoint Designer workflow. http://sharepointsolutions.blogspot.com/2008/10/task-escalation-using-workflows.html Looping Through Items in a SharePoint List with SharePoint Designer Workflows One of the things that most frustrates developers about SharePoint Designer workflows is that there is no convenient way to write loops. Not only can we not create For…Next, For…Each, Do…While, and Do…Until loops within our workflows, but there is no obvious way to loop through items in a list. This article removes that last barrier! http://sharepointsolutions.blogspot.com/2008/05/looping-through-items-in-sharepoint.html Useful SPD workflows A collection of my articles that answer common SPD workflow questions posted on the MSDN forums. http://samar-hossam-sharepoint-spot.blogspot.com/search/label/Workflows%20-%20Useful%20SPD%20workflows

Tuesday, November 11, 2008

MOSS Configuration: How to set a document library column to READ-ONLY

A. Background In this article I describe how to configure the following requirements: - A list contains a custom column which should be filled by a workflow only. - This column should be read-only, i.e. it should neither appear on the New form nor on the Edit form. B. List preparations: 1- Create a custom list called Student Marks. 2- Create the following columns: - Student Name of type Single line of text - English of type Number - Math of type Number - Total of type Number Now the New form looks like this: 3- Hide the Total field from the New and Edit form. - Click Settings > List Settings > Advanced Settings. - Set Allow management of content types? to Yes. - Click OK to get back to the Settings page. - Under the Content Types section, click Item. - Under the Columns section, click the Total column. - In the Column Settings, select Hidden. - Click OK. - NOTE: If you have more than one content type defined on this custom list, then you have to repeat these steps for every Content Type. Now the New form looks like this: C. Workflow in SharePoint Designer: 1- Open Microsoft Office SharePoint Designer 2007. 2- Click File > Open Site. 3- Enter the URL of the site containing our custom list called Price List. 4- Now click File > New > Workflow. 5- On the Define your new workflow page, enter the following data:
  • Name: Calculate Total
  • Attachment List: Student Marks
  • Start Options: Automatically start this workflow when a new item is created
- Click Next, in order to start designing the workflow steps. - Enter Calculate the total as the Step Name. - In the Actions section, select the action Do Calculation. - Click the value link then click fx. For the source select Current Item and for the field select English. - Leave the operator as plus. - Click the other value link then click fx. For the source select Current Item and for the field select Math. - Click the output variable link. Then Create a new variable called calculatedTotal. - In the Actions section, select the action Set field in Current Item. - Click the field link and select Total. - Click the value link then click fx. For the source select Workflow Data and for the field select calculatedTotal. - Click Finish, in order to save and publish the workflow. D. Test the solution 1. Create a new item in the Students Marks list. 2. Check that the workflow has completed successfully. 3. Check that the Total field contains the correct sum.

Monday, November 3, 2008

SPD Workflow: Was the workflow started due to a Create or an Edit action?

A. Introduction When creating a workflow using Office SharePoint Designer, you might choose to start the workflow when a new item is created OR whenever an item is changed. Consider the case that the actions performed in both situations are the same except for one step which should differ based on whether the processed item is a new one or just an updated one. A simple straight-forward solution is to create two workflows that differ only by one step. I don't need to elaborate on how inconvenient this approach is: (1) during the development phase (2) whenever you need to maintain the workflows. As the title conveys, in this article I would like to show how one can use the Conditions section to determine whether the workflow was triggered due to an item's change or a new item's creation. This way, you would need only one workflow which would branch whenever needed and merge back. B. Preparations Create the list, which we would attach the workflow to. For this demo, I have created a custom list called Price List. C. Workflow - Open Microsoft Office SharePoint Designer 2007. - Click File > Open Site. - Enter the URL of the site containing our custom list called Price List. - Now click File > New > Workflow. - On the Define your new workflow page, enter the following data:
  • Name: CreateOrEdit
  • Attachment List: Price List
  • Start Options: Automatically start this workflow when a new item is created and Automatically start this workflow whenever an item is changed
- Click Next, in order to start designing the workflow steps. - Enter Check whether the item is new or updated as the Step Name. - In the Conditions section, select Compare Price List field. - Click the field link and select Created. - Leave the operator as equals. - Click the value link then click fx. For the source select Current Item and for the field select Modified. - Click OK. - In the Actions section, select the action Log to History List. - Click the this message link and type the text: This is a new item. - Click the Add 'Else If' Conditional Branch. - In the Else branch add the action Log to History list. - Click the this message link and type the text: This is an updated item. - Click Finish, in order to save and publish the workflow. D. Test the solution 1. Create a new item. -- Check that the CreateOrEdit workflow has completed successfully. -- Check that the History Log displays the comment: This is a new item. 2. Edit the created item. -- Check that the CreateOrEdit workflow has completed successfully. -- Check that the History Log displays the comment: This is an updated item.

Sunday, November 2, 2008

Custom Workflow Actions: Structure of the .ACTIONS file

When you create a custom workflow activity, you need to create a so-called .ACTIONS file. But a very common questions to beginners is What is the schema of that XML file? In this article I would provide an overview of the .ACTIONS file's structure and some useful documentation links. A. Structure of the .ACTIONS file The following sketch displays the elements contained in the Workflow Actions Schema. Each node links to the corresponding element's documentation page on MSDN. WorkflowInfo Element | |__Conditions Element |.....| |.....|__Default Element |.....| |.....|__Condition Element | |__Actions Element ......| ......|__Default Element ......| ......|__Action Element ............| ............|__RuleDesigner Element ............|.....| ............|.....|__FieldBind Element ............|.....| ............|.....|__Option Element ............| ............|__Parameters Element ............ .....| ............ .....|__Parameter Element B. Useful Links Workflow Actions Schema Overview http://msdn.microsoft.com/en-us/library/bb897626.aspx .ACTIONS File Example http://msdn.microsoft.com/en-us/library/bb897811.aspx Actions Schema Reference http://msdn.microsoft.com/en-us/library/bb897833.aspx Out-of-the box Workflow Actions http://msdn.microsoft.com/en-us/library/bb897644.aspx Out-of-the box Workflow Conditions http://msdn.microsoft.com/en-us/library/bb897890.aspx

Sunday, October 26, 2008

SPD Workflow: Start a workflow when the value of a certain field changes

A. Introduction A common requirement that I usually encounter is how to make a workflow start ONLY when a certain list item's field changes. Therefore, I decided to write this article to show how this can be achieved using SharePoint Designer and an auxiliary custom list. B. Scenario I have a custom list called Price List. This list contains four columns: - Product ID of type Single line of text - Product Description of type Single line of text - Price of type Currency - Availability of type Choice (Options are: Available, Out Of Stock) I would like to perform some actions (e.g. send a notification to a certain user) whenever the value of the Availability field for any item changes. C. Preparations - Create a new custom list called Aux Price List. - Rename the default Tile column to Product ID. - Create a new column called Availability of type Single line of text. D. Item Creation Workflow I will create a workflow that starts upon item creation. This workflow is responsible for copying the value of the Availability field to the Aux Price List. - Open Microsoft Office SharePoint Designer 2007. - Click File > Open Site. - Enter the URL of the site containing our custom list called Price List. - Now click File > New > Workflow. - On the Define your new workflow page, enter the following data:
  • Name: Backup Availability field
  • Attachment List: Price List
  • Start Options: Automatically start this workflow when a new item is created
- Click Next, in order to start designing the workflow steps. - Enter Copy data as the Step Name. - In the Actions section, select the action Create List Item. - Click the this list link. - Select Aux Price List in the List field. - Click the field Product ID and then click the Modify button. - In the To this value, click fx. For the source select Current Item and for the field select Product ID. - Click OK. - Click the Add button. For Set this field, select Availability. - In the To this value, click fx. For the source select Current Item and for the field select Availability. - Click OK. - Click OK to save and close the Create New List Item window. - Click Finish, in order to save and publish the workflow. E. Item Update Workflow This workflow is the one that performs some business related tasks when the Availability value of an item changes. Thus, this workflow will start only when items are changed. - Open Microsoft Office SharePoint Designer 2007 - Click File > Open Site. - Enter the URL of the site containing our custom list called Price List. - Now click File > New > Workflow. - On the Define your new workflow page, enter the following data:
  • Name: React on Availability Change
  • Attachment List: Price List
  • Start Options: Automatically start this workflow whenever a new item is changed
- Click Next, in order to start designing the workflow steps. - Enter Test the Availability field for change as the Step Name. - In the Conditions section, select Compare Price List field. - Click the field link and select Availability. - Leave the operator as equals. - Click the value link and then click fx. - For the Lookup Details, select... -- Source = Aux Price List -- Field = Availability - For the Find the List Item, select... -- Field = Aux Price List: Product ID -- Value = Click fx. For the source select Current Item and for the field select Product ID. - Click OK to save the lookup. - A warning message gets displayed. Click Yes to continue. - In the Actions section, select the action Stop Workflow. - Click the this message link and type the text: Workflow stopped because the Availability field has not changed. - Click the Add 'Else If' Conditional Branch. - In the Else branch add the action Log to History list. - Click the message link and type the text: The Availability field has changed. - Add the action Update List Item. - Click the this list link. - Select Aux Price List in the List field. - Click the Add button. For Set this field, select Availability. - In the To this value, click fx. For the source select Current Item and for the field select Availability. - Click OK. - In the Find the List Item, select ... -- Field = Aux Price List:Product ID -- Value = Click fx. For the source select Current Item and for the field select Product ID. - Click OK to save and close the Update List Item window. - A warning message gets displayed. Click Yes to continue. - Now you can add further steps for handling the event of changing the Availability field, e.g. Send an Email. - Click Finish, in order to save and publish the workflow. F. Test the solution 1. Create a new item. -- Check that the Backup Availability Field workflow has completed successfully. -- Check that the data of the new item is copied correctly to the Aux Price List. 2. Edit the created item by changing any field other than the Avilability. -- Check that the React on Availability Change workflow has completed successfully. -- Check that the History Log displays the comment: Workflow stopped because the Availability field has not changed. 3. Edit the created item by changing the Availability filed. -- Check that the React on Availability Change workflow has completed successfully. -- Check that the History Log displays the comment: The Availability field has changed. -- Check that the corresponding item in the Aux Price list has been updated correctly. G. Related articles SharePoint Designer Workflows: How to Tell Which Fields Have Changed

Tuesday, October 21, 2008

MOSS Administration: Uninstall guide for MOSS 2007

In this article I would like to describe the steps you need to follow, in order to uninstall Microsoft Office SharePoint Server properly. 1. Remove the server from the farm
  • Open SharePoint Central Administration.
  • Browse the Operations tab.
  • Click Servers in farm under Topology and Services.
  • Click Remove Server. Note that after removing the server, you would get and error page.
2. Delete the different databases
  • Shared Services Provider database (e.g. SharedServices1_DB and SharedServices1_Search_DB)
  • Config database (e.g. SharePoint_Config)
  • Content databases (e.g. WSS_Content_Intranet, WSS_Content_MySite, WSS_Content_SSPAdmin and SharePoint_AdminContent_ID)
  • Search database (e.g. WSS_Search_ServerName)
3. Delete the related web applications
  • Go to Start > All Programs > Administrative Tools > Internet Information Services (IIS) Manager.
  • Expand the node corresponding to your server.
  • Expand the Web Sites node.
  • Delete all web sites corresponding to the MOSS site to be uninstalled.
4. Remove the MOSS installation
  • Open the Control Panel.
  • Click Add or remove Programs.
  • Scroll down to Microsoft Office SharePoint 2007.
  • Click the Remove button and follow the instructions.
I hope you find this guide helpful. Here are the links of two further posts that were very useful to me: Uninstall MOSS 2007 and Uninstalling MOSS 2007 Manually. Comments with corrections or improvements are welcomed :) Samar Hossam

Monday, October 20, 2008

MOSS Administration: How to delete a Shared Service Provider?

A. Deleting an SSP There are two methods for deleting a Shared Service Provider: Method 1: Using the deletessp stsadm operation Syntax stsadm -o deletessp -title SSP Name [-deletedatabases] [-force] Parameters
  • title: Required : The name of the SSP to delete.
  • deletedatabases:Optional: Deletes all databases associated with the SSP.
  • force: Optional: Forces the timer job to complete the deletion of a SSP. To delete the default SSP, you must use the force parameter.
Click here for more details about the deletessp operation. Method 2: Via the browser Type in the URL: http:///_admin/deletessp.aspx?sspId=ID of the SSP B. References for the STSADM operations C. STSADM Tip As I often work with the stsadm tool, I have created a batch file that opens the command console and browses the location of stsadm.exe. Here's the content of the batch file: @ECHO OFF cmd /k cd "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"

MOSS Administration: Introduction to NetBIOS names and FQDNs

Overview I have recently encountered a problem while installing and configuring Microsoft Office SharePoint Server 2007; and while trying to fix this issue I was confronted by the terminologies NetBIOS and FQDN. My limited networking background was sufficient to proceed in the instructions and fix the problem. But still I was interested in exploring the differences between NetBIOS and FQDN. In this article I present a simple overview on that topic, which I quote from a book called Troubleshooting Microsoft Technologies: The Ultimate Administrator's Repair Manual(Chapter 2 Fundamental Networking). NetBIOS Names versus FQDNs An aspect of TCP/IP networking that is essential to understand is the concepts of NetBIOS names and fully qualified domain names (FQDNs). With computers running TCP/IP, it is much easier to remember a friendly name than the IP address of a system. NetBIOS naming and FQDNs both give you the ability to associate a friendly name with a network object, but the primary difference between the two is how you see the name written. An FQDN is typically computer name.domain name.domain extension.(Example: www.awl.com) A NetBIOS name is a simple name used to represent a system but is limited in size to 15 characters. For the FQDN www.awl.com, its NetBIOS name equivalent would be www. Now consider how many www's there are out there. If we used NetBIOS on the Internet, there would be no way to tell systems apart, and that is why the naming convention for any distributed networked environment has to be fully qualified domain names. Naming Rules Now that you understand the fundamental differences between NetBIOS naming and FQDNs, let's look at the naming rules associated with each. NetBIOS naming rules:
  • The name can't begin with a number.
  • The name can be no longer than 15 characters.
  • The name can use the characters A-Z, a-z, 0-9, hyphens; and is not case sensitive.
  • The name can have spaces (a space counts as one character).
FQDN naming rules:
  • The name can begin with a number.
  • The name can be no longer than 255 characters (domain controllers are limited to 155 characters).
  • The name can use the characters A-Z, a-z, hyphens, and is not case sensitive.
  • The names cannot have spaces
  • Portions of the name are separated by periods (e.g www.microsoft.com)
Name Resoltuion Methods So you have seen that we can use NetBIOS names and FQDNs as easier methods to remember computers. While we can remember names, something has to exist on the network to connect a name to its corresponding IP address. These are the predominent methods:
  • Domain Name Service (DNS) - The server that resolves FQDNs to IP addresses.
  • Windows Internet Naming Services (WINS) - The server that resolves NetBIOS names to IP addresses.
  • Hosts file - The file stored locally on every computer that maps IP addreses to FQDNs.
  • LMHosts file - The file stored locally on every computer that maps IP addreses to NetBIOS names.
  • Broadcast - A way for your computer to shout out to the network. "Hey does anyone know computer X?" (Routers drop broadcat packets, so broadcasts only work on the subnet connected to the system sending the broadcast. Aslo, broadcasts gobble up netwrok bandwidth)
Finally, I hope this article has provided a basic understanding of NetBIOS names and FQDNs. For much depth explanations, I recommend referring to the book. Samar Hossam