which country user step here?

Tag Cloud

MOSS (47) SharePoint 2007 (37) SharePoint 2013 (23) SharePoint 2010 (22) MOSS admin (17) admin (17) PowerShell (16) developer (16) List (15) WSS (14) sql query (14) MOSS SP2 (13) end user (11) scripting (11) wss V3 (11) Moss issue (8) search (8) permission (7) sql (7) Service Pack (6) database (6) reportadmin (6) workflow (6) Excel (5) client object model (5) CU (4) Client Code (4) Command (4) Cumulative Updates (4) Patch (4) SharePoint designer (4) stsadm (4) ASP.NET (3) Content Database (3) Groove (3) Host Named Site Collections (HNSC) (3) IIS (3) RBS (3) Tutorial (3) alert (3) batch file (3) codeplex (3) error (3) incomming email (3) restore (3) upload (3) Caching (2) Folder (2) Index (2) Internet (2) News (2) People Picker (2) Share Document (2) View (2) Web Development with ASP.NET (2) add user (2) authentication (2) coding (2) column (2) deploy solution (2) domain (2) download (2) enumsites (2) exam (2) export (2) issue (2) june CU (2) mySites (2) network (2) office 365 (2) orphan site (2) performance (2) profile (2) project server (2) query (2) server admin (2) theme (2) timer job (2) training (2) user porfile (2) web master (2) web.config (2) wsp (2) 70-346 (1) 70-630 (1) AAM (1) Anonymous (1) Approval (1) Cerificate (1) Consultants (1) Content Deployment (1) Content Type (1) DOS (1) Document Library (1) Drive Sapce (1) Excel Services (1) Export to Excel (1) Feature (1) GAC (1) Get-SPContentDatabase (1) Get-WmiObject (1) HTML calculated column (1) ISA2006 (1) IT Knowledge (1) ITIL (1) Install (1) Link (1) MCTS (1) Macro (1) Migration (1) My Site Cleanup Job (1) My Sites (1) NLBS (1) Nintex (1) Office (1) Open with Explorer (1) ROIScan.vbs (1) Reporting Services (1) SPDisposeCheck.exe (1) SQL Instance name (1) SSRS (1) SharePoint farm (1) Shared Services Administration (1) Site Collection Owner (1) Site template (1) Steelhead (1) URLSCAN (1) VLOOKUP (1) WSS SP2 (1) XCOPY (1) admi (1) app (1) application pool (1) aspx (1) audit (1) availabilty (1) backup (1) binding (1) blob (1) branding sharepoint (1) cache (1) calendar (1) connection (1) copy file (1) counter (1) crawl (1) custom list (1) event (1) excel 2013 (1) facebook (1) filter (1) fun (1) group (1) iis log (1) import (1) import list (1) improment (1) interview (1) keberos (1) load balance (1) log in (1) metada (1) migrate (1) mossrap (1) onedrive for business (1) operation (1) process (1) publishing feature (1) resource (1) security (1) send email (1) size (1) sps2003 (1) sql201 (1) sql2012 (1) sub sites (1) system (1) table (1) task list (1) today date (1) vbs (1) video (1) web part (1) widget (1) windows 2008 (1) windows 2012 R2 (1) windows Azura (1) windows account (1) windows2012 (1) wmi (1)

Friday, November 18, 2011

Client Object Model - retrieve document library permission




 public void CheckPermission(string siteUrl, string ListName)

        {
            ClientContext clientContext = new ClientContext(siteUrl);
            List curList = clientContext.Web.Lists.GetByTitle(ListName);

            clientContext.Load(curList.RoleAssignments);
            clientContext.ExecuteQuery();


 foreach(RoleAssignment ra in curList.RoleAssignments)

         {
             var p = ra.Member;
             clientContext.Load(p);
             var q = ra.RoleDefinitionBindings;
             clientContext.Load(q);
             clientContext.ExecuteQuery();
               
       
           foreach (RoleDefinition subq in q)
           {
               Console.WriteLine(p.Title+"=="+subq.Name);
         
           }
                                 
            }

         }

Wednesday, October 12, 2011

client code : check all the Sharepoint 2010 group Owner

static void Main(string[] args)
       {

           String sURL = "http://xxxxx/sites/yyyyy";
          
          
           ClientContext clientContext = new ClientContext( sURL);
           GroupCollection collGroup = clientContext.Web.SiteGroups;
                     

           clientContext.Load(collGroup);

           clientContext.Load(collGroup);
               //groups => groups.Include(
                //   group => group.Owner));

           clientContext.ExecuteQuery();

           foreach (Group oGroup in collGroup)
           {
               Console.WriteLine(oGroup.Title +"== "+ oGroup.OwnerTitle);
          
           }

          
           Console.ReadLine();

       }

Thursday, October 6, 2011

Retrieve all document library View method with console c#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Client;
using SP = Microsoft.SharePoint.Client;

namespace ExtractView
{
    class SPView
    {
        public void allview(string siteUrl , string doclib )
       
        {

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;

            List targetList = site.Lists.GetByTitle(doclib);
            ViewCollection collView = targetList.Views;

            ViewCreationInformation viewInfo = new ViewCreationInformation();
          

            clientContext.Load(collView);
            clientContext.ExecuteQuery();

            Console.WriteLine("this is for document lib" + doclib);

            foreach (View oneView in collView)
             Console.WriteLine(oneView.Title);

            
        }


        public void alldoc(string siteUrl)
        {

             ClientContext clientContext = new ClientContext(siteUrl);
            ListCollection collList = clientContext.Web.Lists;                             
          
            clientContext.Load(collList);
            clientContext.ExecuteQuery();

            foreach (SP.List olist in clientContext.Web.Lists)

            {

                allview(siteUrl, olist.Title);
                       
            }

        }

    }
}

=============================================================================================================

to call this method please create static void main to call it.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Client;

namespace ExtractView
{
    class Program
    {
        static void Main(string[] args)
        {
               SPView listview = new SPView();

               listview.alldoc(args[0]);         

        }

        
    }
}

=================================================================================================================

run the xxx.exe parameter(URL)

Wednesday, September 14, 2011

Code to retrieve all the list item detail

using System;
using System.Linq;
using Microsoft.SharePoint.Client;
using SP = Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointServices.Samples
{
class RetrieveListItemsInclude
{
static void Main()
{
string siteUrl = "http://MyServer/sites/MySiteCollection";

ClientContext clientContext = new ClientContext(siteUrl);
SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements");

CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "<View><RowLimit>100</RowLimit></View>";

ListItemCollection collListItem = oList.GetItems(camlQuery);

clientContext.Load(collListItem,
items => items.Include(
item => item.Id,
item => item.DisplayName,
item => item.HasUniqueRoleAssignments));

clientContext.ExecuteQuery();

foreach (ListItem oListItem in collListItem)
{
Console.WriteLine("ID: {0} \nDisplay name: {1} \nUnique role assignments: {2}",
oListItem.Id, oListItem.DisplayName, oListItem.HasUniqueRoleAssignments);
}Console.ReadLine();
}
}
}
 
source code from here

Monday, September 5, 2011

my first client object testing with the windows form :)

follow the step here : http://www.sharepointkings.com/2011/07/client-object-model-part-1.html
please remember to add the  Microsoft.Sharepoint.Client and Microsoft.Sharepoint.Client.Runtime to References.
*my small step over the cilent object model over sp2010
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.SharePoint.Client;

namespace SP2010
{
    public partial class Form1 : System.Windows.Forms.Form
    {
        public Form1()
        {
            InitializeComponent(); //not sure this is for what Smile with tongue out
        }

      public void LoadData()
        {
            string webUrl = "http://xxxxx/sites/content/support"; //replace this with your site URL
            ClientContext context = new ClientContext(webUrl);
            Web web = context.Web;
            context.Load(web);

            context.ExecuteQuery();
            this.label1.Text = web.Title + " " + web.Description;
            this.label2.Text = webUrl;
           
        }

        private void button1_Click(object sender, EventArgs e)
        {
              LoadData();
        }
    }
}

Thursday, August 25, 2011

Metadata navigation > new SharePoint Server 2010 feature that enables users to dynamically filter lists

Metadata navigation is a new SharePoint Server 2010 feature that enables users to dynamically filter lists so they can find what they need. Metadata navigation enables users to select filter options, and it handles performing the query in the most efficient manner possible. Metadata navigation consists of two parts. One part is a set of navigation controls that let a user filter a list that has navigation hierarchies and key filters. The second part is a mechanism for rearranging and retrying queries.

Metadata navigation has retry and fallback logic that attempts to perform queries efficiently by using indexes. If a query will return too many results, the query falls back and returns a subset of the results for better performance. If no appropriate query can be made, fallback occurs and the filters are performed on a limited set of results. Metadata navigation automatically creates indexes. Together retry, fallback, and index management make metadata navigation a very important part of working effectively with large lists. There are two kinds of filtering mechanisms: navigation hierarchies and key filters.

Navigation hierarchies use a tree control to navigate hierarchies of folders, content types, choice fields, or managed metadata term sets. This enables users to use a tree control to pivot on a metadata hierarchy, much as how they navigate folders. When users select an item in a hierarchy for a managed metadata column, all items that match the specified term or any of its descendant child terms are displayed. This is called descendant inclusion, and it can be used on fields that are tied to a managed metadata term set. Users can select the item again to filter on only that particular term and not include the descendant child terms. All metadata navigation queries are recursive and display results from all the folders in the list.

Key filters can be configured to perform additional filtering of results within the hierarchy. For example, you can add the Modified By column as a key filter and then type a user name to obtain results where Modified By matches the entered user. For more information, see Metadata navigation and filtering (http://go.microsoft.com/fwlink/?LinkId=219154). The following figure shows an example of metadata navigation hierarchies and key filters.

Screenshot of key filters list

 

from : http://technet.microsoft.com/en-us/library/cc262813.aspx

Friday, August 5, 2011

First step at sharepoint2010 Client object model

information from : http://msdn.microsoft.com/en-us/library/ee857094(office.14).aspx#Y4347
my first small step
To build the application
  1. Start Microsoft Visual Studio 2010.

  2. On the File menu, point to New, and then click Project.

  3. In the New Project dialog box, in the Recent Template pane, expand Visual C#, and then click Windows.

  4. To the right of the Recent Template pane, click Console Application.

  5. By default, Visual Studio creates a project that targets .NET Framework 4, but you must target .NET Framework 3.5. From the list at the upper part of the File Open dialog box, select .NET Framework 3.5.

  6. In the Name box, type the name that you want to use for your project, such as FirstClientApiApplication.

  7. In the Location box, type the location where you want to place the project.

    Figure 2. Creating a solution in the New Project dialog box
    6fff7a0d-bf31-4042-acb2-72a16fce6e19

  8. Click OK to create the solution.

To add references to the Microsoft.SharePoint.Client assembly and Microsoft.SharePoint.Client.Runtime assembly
  1. The classes that you use in a client object model application are located in Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll. As I mentioned, before you add the references, you must copy those assemblies from the server that runs SharePoint Foundation to the client development computer.

  2. On the Project menu, click Add Reference to open the Add Reference dialog box.

  3. Select the Browse tab, navigate to the location where you put the Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll. Select both DLLs, and then click OK as shown in Figure 3.

    Figure 3. Adding references to the assemblies
    820cc11d-ae55-4acb-9cf5-8272117ce0df

To add the sample code to the solution
  1. In Visual Studio, replace the contents of the Program.cs source file with the following code.

    using System;
    using Microsoft.SharePoint.Client;

    class DisplayWebTitle
    {
        static void Main()
        {
            ClientContext clientContext = new ClientContext("http://intranet.contoso.com");
            Web site = clientContext.Web;
            clientContext.Load(site);
            clientContext.ExecuteQuery();
            Console.WriteLine("Title: {0}", site.Title);
        }
    }

  2. Replace the URL in the ClientContext constructor with the URL to the SharePoint site. Build and run the solution. The example prints the title of the site.

Just as with the SharePoint Foundation server object model, you create a context for the SharePoint site that you want to access. You can then retrieve a reference to the site from the context.

The call to the ExecuteQuery method causes the SharePoint Foundation 2010 managed client object model to send the request to the server. There is no network traffic until the application calls the ExecuteQuerymethod.

An important point to make about this example is that the call to the Load method does not actually load anything. Instead, it informs the client object model that when the application calls the ExecuteQuery method, you want to load the property values of the siteCollection object.

This is the model that all interactions with the server take:

  1. You inform the SharePoint Foundation 2010 managed client object model about the operations that you want to take. This includes accessing the values of properties of objects (for example, objects of the Listclass, ListItem class, and Web class), CAML queries that you want to run, and objects such as ListItem objects that you want to insert, update or delete.
  2. Then you call the ExecuteQuery method. No network traffic occurs until you call the ExecuteQuery method. Until that point, your application is only registering its requests.

As you can see from this example, at its simplest, you first set up a query, and then you execute the queries. This causes the client object model to send traffic to the server and receive a response from it. This next section reviews the model in detail and shows why it is designed the way it is, and finally, how you can build applications by using the model.

Wednesday, August 3, 2011

The days don't have access to SharePoint server

After change the Role from System Engineer to Web design advisor (Content Management ) , no more privilege  to log in server to run STSADM and so on ... :(

ha ha, sometime even site collection admin privilege also don't have ....ask me how to do make mine work automated?  Look like is the time to start on Using the SharePoint 2010 Managed Client Object Model

Blog about this area:

http://blogs.msdn.com/b/ericwhite/archive/2009/11/20/using-the-sharepoint-2010-managed-client-object-model.aspx

http://msdn.microsoft.com/en-us/library/ee857094(office.14).aspx

 

is time to start learn how to edit coding!! ha ha :P this is good start from me to start involve in sharepoint developer area.

Dream target : create migration tools...ha ha..

Wednesday, July 6, 2011

Change the name of the button name on SharePoint list

http://www.mindfiresolutions.com/Renaming-the-menu-items-in-SharePoint-Site-Libraries-and-Lists-for-a-Specific-Site-209.php

 

Renaming the menu items in SharePoint Site Libraries and Lists for a Specific Site

Author: Samarendra Swain

 

In SharePoint document Library/List we find menu items like New, Uploads, Actions and Settings etc. At times there might be requirements to rename these menu items for a specific site. The following Javascript function can be used to achieve the objective.

The code snippet shown below can be called from inside the specific SharePoint Page.

e.g AllItems.aspx page inside a Document Library/List.

This javascript function needs to be called on Page load event using _spBodyOnLoadFunctionNames.push method.

<script language="javascript" type="text/javascript">

_spBodyOnLoadFunctionNames.push("renameMenuItem('New', 'My New')");

_spBodyOnLoadFunctionNames.push("renameMenuItem('Settings', 'My Settings')");

function renameMenuItem(oldMenuItemName, newMenuItemName)
{
    var vAnchorTag;
    var vAllAnchorTags = document.getElementsByTagName('a');
    if(oldMenuItemName.length!=0)
    {
        for (var j = 0; j < vAllAnchorTags.length; j++)
        {
            vAnchorTag = vAllAnchorTags[j];
            if (vAnchorTag.innerText.indexOf(oldMenuItemName)!=-1)
            {
                 vAnchorTag.innerText = newMenuItemName;
                 try
                 {
                     if(newMenuItemName.length != 0)
                     {
                                vAnchorTag.parentNode.previousSibling.firstChild.firstChild.alt
= newMenuItemName;
                     }
                     else
                     {
                                vAnchorTag.parentNode.previousSibling.firstChild.firstChild.alt
= oldMenuItemName;
                     }
                 }
                 catch(err)
                 {
                 }
            }
        } // End For
    } // End If
}// End Function

</script>

Tuesday, May 24, 2011

How to update list item from Collect Data from user at workflow

 

learn new knowledge on how to update on of the column at list item from the collect data from user.

 

when user received the alert from the workflow , user will go to update the task. we can customize the data we need with using Collect Data from user Actions from workflow.

 

below is the step to return the data have input to task and update on the list item.

 

http://office.microsoft.com/en-us/sharepoint-designer-help/collect-data-from-a-user-in-a-workflow-HA010209808.aspx?CTT=5&origin=HA010240415

 

When you design a workflow, you often want to collect information from a participant in the workflow, and then use that information for making further decisions. For example, you might want a workflow to ask a participant to review a document, and then have the workflow perform different actions depending on whether the reviewer approves or rejects the document.

Flow chart that branches depending on the user response

To accomplish this, you add the Collect Data from a User action to your workflow. This action assigns a task to the participant, prompting them to provide the needed information in a custom task form. The information from the custom task form is stored in an item in the Tasks list. At a decision point in a later step, the workflow retrieves the stored information and evaluates it to decide which branch to run.

This article shows you how to collect data from a workflow participant, and then how to use that data in your workflow for making further decisions.

In this article

Which action should I use to create a task?

Tasks are the primary way for a workflow to interact with participants in the workflow. If you want your workflow to require work from people or to get information from them, you can have the workflow create and assign a task. Each time a workflow assigns a task, the workflow pauses until that task is completed. The workflow resumes only when a participant clicks the Complete Task button on the task form.

There are three different actions that create a task, and each action is designed for a specific kind of situation:

  • Collect Data from a User    This action assigns a task to a single user or group and returns the unique ID of the task item that stores the user's answers, so that the workflow can later look up this information by using the ID. With this action, you use the Custom Task Wizard to design a custom task form that collects the information you want. This action creates a task that can be assigned only to a single user or group. If you assign this task to a group, each member of the group receives a task notification, but only one task item is created, and the workflow pauses only until the first person to respond completes the task.
  • Assign a Form to a Group    This action assigns a form to one or more users, and then stores the responses as values in the Tasks list. Unlike the previous action, this action can assign a task separately to multiple people, and the workflow pauses until each person completes their task before it resumes. Also unlike the previous action, this action does not return the ID of the task item for any of the responses, so the workflow cannot look up and use that information later as the basis for making comparisons or decisions. With this action, you also use the Custom Task Wizard to create a custom task form. For more information, see the articleAssign a form to a group in a workflow.
  • Assign a To-do Item    Unlike the other two task actions, this action creates a task form that has no form fields to fill out but instead uses a form where the user simply clicks a Complete Task button when the task is finished. This task can be assigned separately to multiple people, and the workflow pauses until each person marks their task as complete. This action does not return the ID of the task item — and doesn’t really need to because the task does not collect any information that you might want to reference later. For more information, see the article Assign a to-do item in a workflow.

The following table summarizes this information.

ACTION
RETURNS THE TASK ID FOR WORKFLOW LOOKUPS?
CREATES MULTIPLE TASKS?
ENABLES YOU TO DEFINE FIELDS ON THE TASK FORM?

Collect Data from a User
Yes
No
Yes

Assign a Form to a Group
No
Yes
Yes

Assign a To-do Item
No
Yes
No

In addition, several limitations apply to all three task actions:

  • When a workflow assigns a task to a group that is identified by a single alias or address, the workflow creates only one task item, which is then shared by the entire group. Any member of the group can edit that single task form and click the Task Complete button. To assign individual tasks to multiple users (only possible with the Assign a Form to a Group or Assign a To-do Item action), enter each user individually in the Select Usersdialog box.
  • All of the tasks assigned by a single workflow action must be completed before the workflow can continue. If the workflow action assigns individual tasks to six participants, for example, you cannot direct the workflow to continue after only three of the six tasks are completed.
  • After a task is assigned to a participant by the workflow, that task cannot be transferred to any other participant (by delegation, forwarding, etc.). However, anyone with the default Contribute permission level to the Tasks list can edit the task item and thus allow the workflow to continue.
  • A workflow can use each task only once. After you create a task by using the Custom Task Wizard, there is no way to reuse that task later in the workflow. You can create another task that performs the same function, but the task's name will have to be different and unique.

Top of Page TOP OF PAGE

What is a custom task form?

Each time that you use one of the three task actions to create a task, Microsoft Office SharePoint Designer 2007 automatically generates a custom task form for that task. The custom task form is the page that is presented to the workflow participant when they edit the task in the browser.

When you create a task by using the Collect Data from a User or Assign a Form to a Group action, the custom task form can have as many form fields as you choose to create. This example asks the user to enter information in only one field named "Review status".

Custom task form in browser

In Office SharePoint Designer 2007, the custom task form appears as an .aspx page in the folder for that workflow. The file name of the custom task form corresponds to the name that you give the task in the Custom Form Wizard.

Custom task form in Folder List

Custom task forms are attached to the site's default master page and contain a Data Form Web Part to interact with the workflow. The custom task form can be customized for layout and appearance — for example, you can attach a different master page or modify the styles. However, to change what fields appear on the form, you must use the Custom Task Wizard in the Workflow Designer. You cannot change the form fields by editing the Data Form Web Part directly. If you make other customizations to the Data Form Web Part (for presentation and not for functionality), note that those changes are lost each time that the workflow is recompiled. Customizations to the rest of page are preserved.

To change the fields on the custom task form, you must open the workflow in Office SharePoint Designer 2007 (File menu, Open Workflow command). When you open the workflow and edit the task by using the Custom Task Wizard, you see the following warning.

Warning message

If you modify the custom task form and recompile the workflow, all running instances of the workflow continue to run using the new form. If you delete or modify fields (for example, by changing their type or renaming them), a workflow error will occur if the running instances of the workflow reference data that is not what is expected. For example, a running workflow may do a lookup and expect a field to contain data (be non-empty) but now it is empty, or the field may have changed type. Therefore, it is important not to make any change that deletes, renames, or otherwise alters form fields that currently running workflow instances may attempt to reference.

In addition to the custom task form, each time that you use one of the three task actions to create a task, Office SharePoint Designer 2007 automatically generates a content type for that task in the Tasks list. The content type defines the available fields and what format they use, as you specified in the Custom Task Wizard. The name of the content type matches the name that you give the task in the Custom Form Wizard. For example, if you create a task named "Review document", you will see a content type with that name on the Settings page of the Tasks list.

Task content type in the browser

We recommend that you modify workflow content types only by opening the workflow in Office SharePoint Designer 2007, and not by modifying the columns or other settings for the content type in the browser. Modifying the content type in the browser can potentially break the custom task form that it is associated with.

Top of Page TOP OF PAGE

What is a list item ID?

A list item ID is a unique row number. When a workflow participant clicks eitherComplete Task or Save Draft on the custom task form, the information submitted in the form is stored in an item in the Tasks list. The content type for that task defines the columns, and the list item ID identifies a specific item, or row. Each item in the Tasks list (or any list or library) has a unique ID. In the browser, you can add the ID column to any view of a list or library.

ID column added to default view

In addition, when you view a list item on a page in the browser — for example, when you click View Properties to see the item details on DispForm.aspx — the ID of that list item is visible in the URL as part of the query string. All standard SharePoint forms contain an ID parameter in the query string section of the URL.

List item ID highlighted in the URL of a task item

When a workflow runs the Collect Data from a User action, the workflow creates a single task and stores the list item ID of that task in a variable. The workflow can later use that variable to look up the specific task item.

Top of Page TOP OF PAGE

Step 1: Collect data from a user

First you want to use the Collect Data from a User action to create the custom task form, assign the task to a single user or group, and then store the ID of the task item in a variable. The workflow will later use the task item ID to look up the values submitted by the user in the task form.

In this example, your team uploads documents to a library named "Documents for review". When a document is added to the library, the workflow creates a task named "Review document". The person to whom the task is assigned must choose one of two options from a drop-down menu when they edit the task: Approved or Rejected.

NOTE   This workflow is a custom approval workflow, but it does not use the Content Approval feature in Windows SharePoint Services and does not change the Approval Status field of the document. The Content Approval feature in Windows SharePoint Services presumes two different permission levels: one that does not include the Approve Items permission (for people submitting content for approval), and a second that does include the Approve Items permission (for people approving content). However, a workflow designed in Office SharePoint Designer 2007 always impersonates the permission level of the person who starts the workflow. If a person who does not have the Approve Items permission starts a custom workflow that tries to update the Approval Status field of the current item, the workflow will stop because the person who started the workflow does not have permission to approve items.

  1. On the File menu, point to New, and then click Workflow.
  2. On the first page of the Workflow Designer, name the workflow, choose the list or library that the workflow will be attached to, and then select the check boxes for the start options that you want.

First page of Workflow Designer

  1. Click Next.
  2. Click Actions, and then click Collect Data from a User.

If this action does not appear in the list, click More Actions to see the full list.

  1. In the action, click data.
  2. On the first page of the Custom Task Wizard, click Next.
  3. In the Name box, type a name for this task.

NOTE   The task name must be unique in the current site.

  1. In the Description box, type any general instructions to the recipient of the task.

This description appears at the top of the custom task form, so include here any instructions that you want the workflow participant to see, not just a general description.

Second page of Custom Task Wizard

  1. Click Next.
  2. Click Add to define a custom form field for this task.
  3. In the Field name box, type a name for this field.
  4. In the Description box, type the question for which this form field is storing the answer.
  5. In the Information type list, choose an option that formats the field appropriately for the type of information that you are collecting.

First page of Add Field dialog box

  1. Click Next.
  2. The next page of the wizard varies depending on the Information type that you chose on the previous page. Specify the settings that you want.

In this example, type Approved, press ENTER, and then type Rejected.

  1. In the Display as list, click Drop-down menu.
  2. Clear the Allow blank values check box because you want the reviewer to choose one of the two options.

Second page of Add Field dialog box

  1. Click Finish twice.

The following illustration shows how this task will be displayed to the workflow participant in the browser when they edit the task. This is the custom task form — Review document.aspx — that you just designed by using the Custom Task Wizard.

Custom task form in browser

Back in the Workflow Designer, you still need to set the second and third parameters in the Collect Data from a User action.

  1. In the action, click this user.
  2. In the Select Users dialog box, type a name or e-mail address, or click an existing user or group in the list, and then click Add.

NOTES

  • With the Collect Data from a User action, the workflow creates only one task, which you can assign to only one person or group. For more information, see the earlier section Which action should I use to create a task?
  • Instead of entering a specific user name or e-mail address, you can store this information in a separate list, and then use a workflow lookup to get this information. This way, various users can be configured as workflow participants without you having to modify the workflow itself. Alternatively, you can create a new SharePoint group, and then add users to the group whom you want to be workflow participants. For example, you can create a group named Approvers, add one or more users to it, and then configure this group as part of the Collect Data from a User action (keeping in mind that only one task is created, which can be edited by only one person).
  1. Click OK.
  2. In the action, click the third parameter, and then click Create a new variable.

You want to create a new variable instead of using the default name (Variable: collect) when your workflow will have multiple variables and you want to give the variable a more descriptive name.

Create a new variable option

  1. In the Edit Variable dialog box, type a name that describes the value that the variable is storing.

Edit Variable dialog box

For this variable, List Item ID is the only choice in the Type list. For more information about list item IDs, see the earlier section What is a list item ID?

  1. Click OK.

At this point, your action should look like this.

Collect Data from User action

Top of Page TOP OF PAGE

Step 2: Set a workflow variable

At this point in the workflow, a workflow participant submits a completed task, and the review status that person submits is stored in a field or column in the Tasks list, as shown here.

Review status in completed task item

How do you get at this information to use it in another step in the workflow? You use the Set Workflow Variable action to look up the value of the Review status field for the task that the user edited, and you store the value of this field in a new variable — in this example, named Review status.

By looking up and storing the review status in a new variable, you can now use this variable as the basis for future comparisons. This is a best practice because the workflow now makes it clear where the data is coming from, and this data can be reused more easily — multiple times, if necessary.

  1. Click Actions, and then click Set Workflow Variable.

If this action does not appear in the list, click More Actions to see the full list.

  1. In the action, click workflow variable, and then click Create a new variable.

First parameter of the Set Workflow Variable option

  1. In the Edit Variable dialog box, type a name that describes the value that the variable is storing.
  2. In the Type list, click the type of data that the variable is storing.

In this example, click string because this variable will store the review status ofApproved or Rejected, which are both text strings.

Edit Variable dialog box

  1. Click OK.
  2. In the action, click value, and then click Display data bindingButton image.
  3. In the Define Workflow Lookup dialog box, choose the following options:
    • Source: Tasks    If more than one tasks list is available, choose the list that contains the custom form field that you created in the previous section.
    • Field: Review status    Choose the custom form field that you created in the previous section.
    • Field: Tasks:ID
    • Value: Click Display data bindingButton image.
  4. In the second Define Workflow Lookup dialog box, choose the following options:
    • Source: Workflow Data
    • Field: Variable: ID of Review document task

Define Workflow Lookup dialog box

  1. Click OK.

The final workflow lookup should resemble the following. This lookup says, "Go to the Review status field in the Tasks list. Then go to the row in the Tasks list whose ID matches the ID stored in the variable for this instance of the workflow." If the workflow runs and creates a task whose ID is 3, this lookup retrieves the value of the Review status column from the third row in the Tasks list. The next time the workflow runs, this ID may be 4, so the lookup goes to the fourth row, and so on.

Define Workflow Lookup dialog box

  1. Click OK.

At this point, your rule should look like this.

Rule in Workflow Designer

Top of Page TOP OF PAGE

Step 3: Use the variable to make decisions

In step 1, you created a custom task form to collect data from a user and store the ID of the task item in a variable. In step 2, you used the task ID variable to look up the user response and store that particular response in a new variable. Now that you have this variable — in this example, Variable: Review status — you are ready to use it as the basis for making decisions in the workflow. To do this, use theCompare any data source condition.

For example, you can add a step to your workflow that says if Variable: Review status equals Approved, run these actions. But if Variable: Review status equalsRejected, run different actions.

CREATE THE FIRST CONDITIONAL BRANCH

The first conditional branch compares the value that is stored in Variable: Review status. If the value equals Approved, the workflow will perform any actions associated with this condition.

  1. In the Workflow Designer, under Workflow Steps, click Add workflow step.
  2. Click Conditions, and then click Compare any data source.
  3. In the condition, click the first value hyperlink, and then click Display data bindingButton image.
  4. In the Define Workflow Lookup dialog box, choose the following options:
    • Source: Workflow Data
    • Field: Variable: Review status.

Define Workflow Lookup dialog box

  1. Click OK.
  2. In the condition, leave equals as the value for the second parameter.
  3. In the condition, click the second value hyperlink, type Approved, and then press ENTER.

Condition in Workflow Designer

CREATE THE SECOND CONDITIONAL BRANCH

The second conditional branch handles the case where the value stored inVariable: Review status equals Rejected.

  1. Click Add 'Else If' Conditional Branch.
  2. Click Conditions, and then click Compare any data source.
  3. In the condition, click the first value hyperlink, and then click Display data bindingButton image.
  4. In the Define Workflow Lookup dialog box, choose the following options:
    • Source: Workflow Data
    • Field: Variable: Review status.

Define Workflow Lookup dialog box

  1. Click OK.
  2. In the condition, leave equals as the value for the second parameter.
  3. In the condition, click the second value hyperlink, type Rejected, and then press ENTER.

Before you add any actions to the condition in each branch, this step of the workflow should look like this.

Else If conditional branch in Workflow Designer

  1. To complete this step in the workflow, click Actions, and then add whatever actions you want to each conditional branch.

Top of Page TOP OF PAGE

Quick reference: A summary of the steps

For quick reference, here is a summary of the steps presented in the three preceding sections:

  1. Add the Collect Data from a User action:
    • For the first link, use the Custom Task Wizard to create the custom task form.
    • For the second link, select a single user a group to assign the task to.
    • For the third link, create a variable of the List Item ID type to store the ID of the task item that the user edits.
  2. Add the Set Workflow Variable action:
    • For the first link, create a variable to store the actual value (not just the ID) of a specific field from a specific row in the Tasks list.
    • For the second link, look up the field whose value you want in the Tasks list, by using the value stored in the List Item ID variable to retrieve the specific list item (or row).

This lookup should resemble the following example. This lookup says, "Go to the Review status field in the Tasks list. Then go to the row in the Tasks list whose ID matches the ID stored in the variable for this instance of the workflow." If the workflow runs and creates a task whose ID is 3, this lookup retrieves the value of the Review status column from the third row in the Tasks list. The next time the workflow runs, this ID may be 4, so the lookup goes to the fourth row, and so on.

Define Workflow Lookup dialog box

  1. Create a new workflow step.
  2. Add the Compare any data source condition:
    • For the first link, choose the variable that you set to an actual value in step 2.
    • For the second link, click a comparison.
    • For the third link, enter a value that you want to compare with the value stored in the variable.
  3. Add any actions that you want to run if this condition is satisfied.
  4. Click Add 'Else If' Conditional Branch and repeat steps 4–5 to create additional branches.

Sunday, May 22, 2011

SharePoint Calculated Value Nested

http://office.microsoft.com/en-us/windows-sharepoint-services-help/if-function-HA001161010.aspx

 

keep track this formula for nested function , so i can use this to select other option to show here as lookup list

Example set 3

image

45
=IF([Score]>89,"A",IF([Score]>79,"B", IF([Score]>69,"C",IF([Score]>59,"D","F"))))
Assigns a letter grade to the first score (F)

90
=IF([Score]>89,"A",IF([Score]>79,"B", IF([Score]>69,"C",IF([Score]>59,"D","F"))))
Assigns a letter grade to the second score (A)

78
=IF([Score]>89,"A",IF([Score]>79,"B", IF([Score]>69,"C",IF([Score]>59,"D","F"))))


Assigns a letter grade to the third score (C)

 

In the preceding example, the second IF statement is also the value_if_false argument to the first IF statement. Similarly, the third IF statement is the value_if_false argument to the second IF statement. For example, if the first logical_test ([Score]>89) is TRUE, "A" is returned. If the first logical_test is FALSE, the second IF statement is evaluated, and so on.

 

The letter grades are assigned to numbers using the following key (assuming use of integers only).

 

IF SCORE IS
THEN RETURN

image

Tuesday, May 3, 2011

About site Template and site definition

 

Just notice the enterprise tab is not available when i try to create on our production , look like is someone hiding it. So try find some information on internet to see how to disable the settings .

 

some information to keep track about template topic.

 

What are site templates? > Here

 

Register site definitions > Here (below article )

 

Last night, Carl and I did end up recording the sequel to the first SharePoint 2007 DNRTV show we did earlier. In this episode, I had a chance to talk more about content types, and then I ran through a full-fledged example demonstrating an InfoPath Forms Services based solution solving a real life problem. And then after that I demonstrated creating KPI (key performance indicator) reports based on data collected via infopath forms running in a web browser.

All in all, the show I think, turned out quite well. I will blog about it when it is online.

But, that is not what this blog post is about. When Carl and I were recording, based on a conversation, I had alluded to the fact that you can create your own site definitions and register them within SharePoint 2007. How you ask? It’s a question of twiddling with a bunch of XML files. To which, of course the developer world comes to a screeching halt.

Yes, SharePoint does suffer from XMLITIS, but I have blogged about that as one of the criticisms, and let us get over that.

The real Q is, how can you, register your own site definitions. Well here is how.

1.

First you need a custom site definition. As you may be aware, a custom site definition is nothing but a logical grouping of features, lists, web parts, and a whole bunch of other things, that together make a site. For instance, I could create a custom site definition for a “Blog reader” application. (Speaking of which, in a week or two, the next issue of code-magazine will contain an article from me, demonstrating exactly how to create a blog-reader application a.k.a. bloglines/newsgator etc in SharePoint). All site definitions reside as a bunch of files at the following location.

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates

(Note: I am almost done reviewing Scot Hilier’s upcoming Apress book on SharePoint 2007. He explains this very well in Chapter 11, and I strongly recommend you picking a copy of it – the book is simply excellent, and yes I will post a full review later).

Now in that directory, there are a bunch of site definitions already created. You can create one of your own, but since this blogpost doesn’t talk about that – go ahead and copy paste, “BLANKINTERNET” to a directory called “Sahil”

2.

Now ideally, the directory “Sahil” which contains the details of your site definition, should contain something meaningful in it – so a blogreader site definition will contain the necessary lists, features etc. But ignoring that, let us next look at, how you can register this new Site definition, in SharePoint.

Now at this path –

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\

You would note a curiously named directory called “1033”. 1033 is the culture number for en-us (US English). Under 1033\Xml, there are a bunch of XML files. Strangely enough, many of them are named as “WebTemp*.xml”. That is where you need to put this new site definition’s information, so SharePoint will understand it. Go ahead and copy paste webtempsps.xml and call the new file webtempsahil.xml. The name is important, since SharePoint will look for all files that match “WebTemp*.xml”.

3.

Now go ahead and edit the webtempsahil.xml file to look like as below.

<?xml version="1.0" encoding="utf-8"?>
<!-- _lcid="1033" _version="12.0.4407" _dal="1" -->
<!-- _LocalBinding -->
<Templates xmlns:ows="Microsoft SharePoint">
  <Template Name="Sahil" ID="10001">
    <Configuration ID="0" Title="Sahil's site" Hidden="FALSE"
ImageUrl="/_layouts/1033/images/IPPT.gif" Description="This is the custom site I was talking about." SubWebOnly="FALSE" DisplayCategory="Winsmarts">    </Configuration>
  </Template>
</Templates>

A few things that will jump out at you from the above XML file.

  - ID must be greater than 10000, so your IDs don’t screw up SharePoint’s.
  - You have a whole bunch of other control from the various possible elements, I think the above are self-explanatory.

4.

Now go ahead, and do an iisreset, and try creating a site collection under SCAW (SharePoint Central Web Administration), or a site under a site collection through various means. You should see something like the following in the page that prompts you to create new sites:

Sharepoint 2007 Site Definition

Note that the text, the image, and everything else has been picked from WebTempSahil.xml.

Now how cool is that J!!? Now you can merrily create your custom site definitions, register them, and create them on a per-demand basis.

In further blog posts, I will cover various other aspects of Site Definitions. Until then, Rock On!!

Monday, April 25, 2011

About Alert email issues

Issues : new item assign to task list , owner not receive alert

Step to check:

stsadm -o getproperty -pn job-immediate-alerts -url http://abc.com/sites/XXXX

this command is check the alert timer job status :

Restults:
<Property Exist="Yes" Value="every 5 minutes between 0 and 59" />
which  mean the alert timer will check every 5 minutes.
*normally this is standard setting

Next Step:

Run following command to check from SQL server whether new item created or not :
· use [content_DB
]
select top 50 itemname,EventData,ACL,* from EventCache order by EventTime desc

you should see the new created item , else which mean something wrong.

Solution :

create new list and try again.

ha ha..is not perfect solution but anyhow let me resolve mine problem.

just notice have good post about the alert :
http://msmvps.com/blogs/bradley/archive/2009/03/22/how-to-troubleshoot-alerts-in-wss-3-0-moss.aspx

Thursday, April 21, 2011

Only with Document library permission is unable to subscribe Alert me!

Issues :

 

user only have full control permission at document library, when user try to click on alert me setting then will show Error: Access Denied

 

Root cause:

 

this is by design on Microsoft product or maybe is bug :D

When you click on the Alert me you will route to the page sites/abc/_layouts/XXXXX , which is needed read permission at site level.

 

Solution:

 

1. Grant user view permission at site level. > if allow user to see other information

2. If user using client Microsoft outlook 2007 then can direct sync the folder to outlook ( if have any new document upload then you will see unread document at outlook)

3. Admin can help user add the alert.

Tuesday, April 19, 2011

Using Marco to save file to sharepoint document library :)

 

Just learnt something new from user, which is we can run macro then the excel file can save to SharePoint document library .

 

here is the code :

 

Sub TestSave()
     FolderPath = “http://sharepoint.abc.com/sites/abc/docmentLibrary/”
         SavePath = FolderPath & "sinpeow.xls"
     ActiveWorkbook.SaveAs Filename:=SavePath, FileFormat:=xlNormal
End Sub

Tuesday, April 5, 2011

How Many current connection to your IIS ?

Recently server is out of memory , so thinking to check and see how many connection is connected to my sharepoint web application.

 

At last have found one counter is under Web services > current Connection.

 

This counter is show how many current connection is connected to your web application.

 

Run Perfmon then add the counter , you will see it.

Wednesday, March 23, 2011

SharePoint List filter with [Null] ?

thinking to find any parameter is available to Filter by empty Field at SharePoint list. But  i found one article , is not with Null….is with nothing to compare mean is null!! ha ha..let me share it at below :

 

http://www.endusersharepoint.com/2009/01/23/filter-by-an-empty-field/

 

I ran into a little quirk this morning that turned out to have an interesting solution. When authors submit articles to the Article Submission Library at EndUserSharePoint.com, there is a date column named “Actual Publication Date” to compare against the “Scheduled Publication Date”.

I want to create a view that shows only the articles that have not been published.

My first pass used the filter section to say “Show items when Actual Publication Date is greater than 1/1/2008″. I figured since it was a date column, any item that had a date in that field would not show up in the view. Nope… didn’t work.

Then I thought “What if you filter for an empty field?” So this time, I set filter to “Show items when Actual Publication date is equal to” and left the value field empty…. Score!!!

Weird one… don’t compare against the date, just leave the filter value empty. You learn something new everyday.

Tuesday, March 22, 2011

wohoo!! 32bit and 64bit in the SharePoint farm :D

Recently our sharepoint Farm facing out of memory issues when downloading large file. After investigation , analyst on the memory dump we have notice is because of the workload… so our option have 2 , one is upgrade to 64bit sharepoitn farm or add on more web front end server.

suddenly read the article here about performance : http://technet.microsoft.com/en-us/library/cc298550%28office.12%29.aspx

just get to know 32bit and 64bit SharePoint server can mix up :)

Mixing 32-bit and 64-bit servers can affect load balancing. You can run an environment that has some Web servers running the 32-bit version of Office SharePoint Server 2007 and others running the 64-bit version. However, there is a risk that the 32-bit Web servers might become overloaded if the network load balancer is configured to use a less-intelligent model such as round robin. We recommend that you configure the load balancer to manage distribution based on load.

Additionally, deploying both 32-bit and 64-bit servers increases the maintenance overhead for the farm. This is because third-party applications, custom solutions, patches, and software updates for both architectures must be tracked and managed independently

 

the benefit i can think of is we can have less down time to conver our fram from 32 bit to 64 bit by mixing it. :D

Thursday, February 24, 2011

sub sites owner with Full Control unable to add Content Editor Web Part

after so many year at sharepoint , just notice web part also have permission setting.

 

below is the detail from the forum.

 

 

http://www.tek-tips.com/viewthread.cfm?qid=1444650&page=3

 

Background: SharePoint V3 on a hosted server. The user is a "site owner" and "site owners" have "full control" over the site.  "full control" has all the options that can be selected for security.  This is a sub-site to the main SharePoint site and it does not inhearit security from the parent site.  I want site owners to have full control over there individual sites, but not have control over other's sites.  
Problem: When the user goes to add a web part to the "Home" page of the site via selecting "Site Actions" - "Edit Page" the only web parts that are available to them are the "Lists and Libraries" web parts that consist of "Announcements", "Calendar", "Links", "Shared Documents", "Tasks", and "Team Discussion".
When a Site Collection Administrator does the same thing as above, they see all the web parts listed above as well as "Miscellaneous" web parts consisting of "Content Editor Web Part", "Form Web Part", "Image Web Part", "Page Viewer Web Part", "Relevant Documents", "Site Users", "User Tasks", and "XML Web Part".  Is it possible to make these web parts accessible to the owners of sub-sites with out giving them full control over the entire SharePoint site hierarchy?

 

 

I believe I figured out a solution.  So, if your curious, here is how I fixed it.
Logged into the top level SharePoint site as a site collection administrator.
Select "Site Actions" - "Site Settings"
In the "Galleries" Colum, select "Web Parts"
With the Web Part Gallery open, select the "Settings" menu and select "Gallery Settings"
Now you should be in the Customize Web Part Gallery window.  In the "Permissions and Management" column, select "Permissions for this gallery".
In the "Permissions: Web Part Gallery" Select "Actions" - "Edit Permissions"
Select "OK" to the pop up that is displayed warning you that you are about to create unique permissions, and now you can select "New" and add additional users to the Gallery.
This will allow whomever you add to see all the Web Parts available.

Monday, February 21, 2011

Command line method to create large files

wohoo… finally get to this lost time command forget in my mine.~~

 

sometime need to have huge file to upload to SharePoint for testing or network testing or do what ever test need to have huge file.

 

simple command below for you to generate the large dump files!!

 

 

You can easily create dummy file of specific size which do not contain any datausing Fsutil command.

fsutil file createnew <name of file> <size in bytes>

Following is example to create dummy file of 10MB size in ‘temp’ folder of E drive.

 

fsutil file createnew e:temptempfile.txt 10000000

Wednesday, February 16, 2011

Introduction to workflows

Microsoft Office SharePoint Designer 2007 another article from Microsoft

 

Across your enterprise, teams use Microsoft SharePoint sites to collaborate on documents and share information. You want to build a SharePoint application that improves team productivity and efficiency, but you don’t want to write code. Where do you start?

With Microsoft Office SharePoint Designer 2007, you can design workflows that add no-code application logic to your SharePoint sites and applications. Using the Workflow Designer, you create rules that associate conditions and actions with items in SharePoint lists and libraries. Changes to items in lists or libraries trigger actions in the workflow.

For example, suppose that a team's primary responsibilities are writing, revising, and approving contracts. These contracts are stored in document libraries on the team site. With Office SharePoint Designer 2007, you can create a workflow that sends a notification e-mail message to the reviewer when a new contract has been uploaded to the site. At the same time, the workflow creates a task in the Tasks list for the reviewer. When that person reviews the contract and marks the task as complete, different actions are triggered depending on whether the contract is assigned a status of Approved or Rejected.

Team efficiency and productivity improve because the workflow drives the process so that the team can focus on doing the work, rather than on managing the workflow. And no programming is required to build such a solution. By creating rules in the Workflow Designer, you can quickly add interactivity to a SharePoint solution or application.

This article introduces the basics of workflows. When you understand the basic building blocks of a workflow — events, actions, conditions, and steps — you can quickly add application logic to your SharePoint applications.

IMPORTANT   To create a workflow, your SharePoint site must be located on a server running Windows SharePoint Services 3.0.

In this article

What is a workflow?

Your team uses a SharePoint site to collaborate and store valuable business information in SharePoint lists and libraries. With Office SharePoint Designer 2007 , you can now attach application logic to documents or items in these lists and libraries.

With the Workflow Designer, you can attach a sequence of conditions and actions to a list or library — this sequence is a workflow. A workflow is a natural way to organize and run a series of actions that correspond to a work process. This process can control almost any aspect of a list item in Windows SharePoint Services 3.0, including the life cycle of that item. The workflow can include both actions performed by people (or workflow participants) and actions performed by the workflow. Workflow participants can interact with the workflow through the Tasks list, where a workflow can create a task for someone and remain paused until the task is marked complete.

Workflows can be as simple or as complex as your business processes require. You can create a workflow that the user initiates, or a workflow that is initiated automatically based on an event, such as when a list item is created or changed.

In general, when you use Office SharePoint Designer 2007 to design a workflow, you follow these basic steps:

  • Use the Workflow Designer to choose and assemble the conditions and actions that define the steps of the workflow.
  • Have Office SharePoint Designer 2007 automatically generate any ASP.NET forms for workflow initiation or any custom SharePoint task, if necessary.
  • Customize the workflow forms, if necessary.

You can think of a workflow as a flowchart of actions with a beginning, an end, and a sequential flow from start to finish. Workflows can incorporate parallel branches, but ultimately they progress from the initial action to the final action.

For example, suppose you were to chart the workflow described earlier that routes a document in Windows SharePoint Services 3.0 for approval. When the workflow starts, it automatically notifies the specified reviewer by e-mail that they have a document to review. The reviewer then reviews the document, and changes the status of the document to indicate that they have completed their task, and whether they have approved or rejected the document. Based on the reviewer response, the workflow proceeds down one of two parallel branches. If the reviewer approves the document, the workflow moves the approved document to a specific document library, and then sends an e-mail message to the entire team notifying them of the approved document. If the reviewer rejects the document, the workflow notifies the document author of this. In either case, the workflow then reaches its end and the process is completed.

Workflow process flow chart

Top of Page TOP OF PAGE

What are events, actions, conditions and steps?

These are the building blocks of a workflow. A workflow consists of one or more steps, and each step consists of actions and any associated conditions. Each workflow is initiated by an event.

WHAT ARE EVENTS?

An event is what starts or initiates a workflow. There are exactly three events that can start a workflow:

  • An item is created.
  • An item is changed.
  • A workflow participant clicks a start button on the SharePoint site.

It is important to understand that a workflow created with Office SharePoint Designer 2007 is always attached to exactly one list or library in a SharePoint site. When you design a workflow, you choose which list to attach it to. An event in this list starts the workflow.

You can create a workflow that a participant starts manually, or a workflow that is started automatically when a list item is created or changed. For example, in the document approval workflow, you want to design the workflow so that it starts automatically whenever someone adds a document to the Shared Documents library. On the File menu, point to New, and then click Workflow. In the Workflow Designer, you see the following page.

Define workflow - document approval

When a workflow participant starts a workflow manually, that person first browses to the list or library that the workflow is attached to. Any person with at least the Contribute permission level can initiate a workflow that is designed to start manually. The participant clicks an item, clicks Workflows on the menu, and then chooses a workflow from a page that displays all workflows associated with that item. The participant fills out a workflow initiation form, if necessary, and then initiates the workflow by clicking the start button on the form. Initiating a workflow creates a new instance of that workflow for that specific item.

Workflow command on list item

NOTE   The Workflows command is available only when the item is in a list or library that has at least one workflow attached to it.

For a workflow that is started manually, the initiation form can be as simple as the following.

Example of workflow start button on list item

You can also add custom fields to an initiation form when you design the workflow. Workflow participants can then provide information to the workflow by filling out this form, and those settings are passed to the workflow. A new workflow instance starts, and that workflow can then look up and use the information provided through the form at any point in the workflow.

WHAT ARE ACTIONS?

An action is the most basic unit of work in a workflow. Office SharePoint Designer 2007 provides a set of ready-made, reusable actions for you to incorporate into your workflow. For example, your workflow can:

  • Create, copy, change, or delete list items (including documents).
  • Check items in or out.
  • Send an e-mail message.
  • Create a task for someone on the Tasks list of your team site.
  • Collect data from a participant that can be referenced later in the workflow.
  • Pause or stop the workflow.
  • Log workflow information to a History list to use for repudiation or workflow debugging.
  • Set workflow variables or perform calculations.

A workflow can contain any number of actions. The actions just listed are performed by the workflow, but other actions might be performed by workflow participants. For example, the document approval workflow is comprised of five actions. Four of these actions are performed automatically by the workflow, but one of these actions — actually reviewing the document — is done by a workflow participant. Actions done by a workflow participant are represented by tasks assigned to that person in the Tasks list. The five actions in the example workflow are:

  • Send an e-mail message to notify the reviewer
  • Review the document (a task assigned to a workflow participant)
  • Move the document to the Approved document library
  • Send an e-mail message to notify the team
  • Send an e-mail message to notify the document author

In the most basic sense, when you design a workflow, you identify the necessary sequence of actions, and then you assemble that sequence of actions by using the Workflow Designer. For example, in the document approval workflow, the first action that you want is to send an e-mail message to notify the reviewer.

Flowchart, send e-mail to reviewer

So in the Workflow Designer, you choose that action for the first step in the workflow.

Actions list

WHAT ARE CONDITIONS?

When you design a workflow, you can use the Workflow Designer to create rules that apply conditional logic to SharePoint lists and items. A rule establishes a condition where the workflow performs the associated action only if that condition is true. For example, you can create a rule where the workflow sends a reviewer an e-mail message only if an item is created by a specific person. You can also add clauses to a condition. For example, you can create a rule where a reviewer is sent an e-mail message only if an item is both (1) created by a specific person and (2) the document title contains specific keywords. Finally, you can associate multiple actions with one condition. For example, you can create a rule where if an item is created by a specific person, then (1) the reviewer is sent an e-mail and (2) workflow information is logged to the History list.

Choose conditions and actions

To sum up, a rule is a condition associated with one or more actions: If all clauses in the condition are true, do all the associated actions.

In the previous example, the user specified only one condition. However, you can create multiple conditions for a step in the workflow. Multiple conditions create branches in the workflow: If condition A is true, do one action; if condition B is true, do a different action. To add a branch to a step, click Add 'Else If' Conditional Branch. For example, in the document approval workflow, if the reviewer approves a document, the workflow performs one action (or series of actions); if the reviewer rejects a document, the same workflow performs a different action. This is a conditional branch.

Flowchart example, approver reviews document

In the Workflow Designer, this step has two branches and looks like the following. The green diamond indicates that the step has a conditional branch.

Conditional branch with two conditions

You can also create a branch that has no specific condition. This way, the workflow performs one action if a condition is true and a different action if the condition is false. For example, the following step in a workflow sends a message to the team only if the condition is true; else, the workflow sends a message just to the document author. By adding a branch with no specific conditions, the workflow performs the action in that branch in any case where the condition in the first branch is false.

Conditional branch with no second condition

NOTE   Branching in a workflow cannot extend from one step to another. A set of 'Else If' branches is always contained in a single step.

Office SharePoint Designer 2007 provides several ready-made, reusable conditions for you to incorporate into your workflow. For example, you can specify that the workflow performs the associated actions only if an item:

  • Is created or modified in a specific time span.
  • Is created or modified by a specific person.
  • Has a title field that contains specified keywords.
  • Is a file of a specific type or has a file size in a specific range. (This condition is available only when the workflow is attached to a document library.)

In addition, you can create custom conditions and advanced conditions where you can specify a wide range of parameters. With custom conditions, you can compare a field in the current list with a value. For example, you can create a custom condition where if the Approval Status field equals Approved, do the associated action. With advanced conditions, you can compare one value to another value. This allows you to create a comparison between a field in any list and a value from another list. For example, you can create an advanced condition for the Shared Documents library where if the value of the Status field in the Tasks list equals Pending, do the associated action.

NOTE   An action does not require a condition. For example, the first step of the example document approval workflow sends an e-mail to notify the reviewer. This action does not have a condition associated with it.

PARALLEL VS. SERIAL ACTIONS

When you have more than one action associated with a condition, the actions can be set up to run at the same time (parallel) or one after another (serial).

Run actions in parallel or serial

Serial actions    For example, in the document approval workflow, you can set up two actions so that when a document is approved, a message is sent and then (afterward) the document is copied to the Approved document library. In the Workflow Designer, then indicates that the second action occurs after the first.

Serial action with 'then'

Parallel actions    For example, in the document approval workflow, you can set up two actions so that when a document is approved, a message is sent and (at the same time) the document is copied to the Approved document library. In the Workflow Designer, and indicates that the second action occurs at the same time as the first.

NOTE   Parallel actions are not absolutely simultaneous; the exact order cannot be specified and may vary each time the workflow runs.

Parallel action with 'and'

NOTES

  • In any given rule (conditions and actions), all actions must be either serial or parallel.
  • A set of serial or parallel actions must be contained within a single step.
WHAT ARE STEPS?

A workflow is comprised of one or more steps. Each step can contain any number of actions and associated conditions. You can think of steps simply as pages in the Workflow Designer. For example, the document approval workflow has two steps, as shown in the Workflow Designer.

Workflow steps, add a step

Steps allow you to group conditions and actions so that one set of rules (conditions and actions) can be evaluated and performed before a second set.

One step or many? Some workflows can be designed either as a sequence of actions within one step, or as a sequence of steps.

For example, the following three actions could be Step 1 of a basic one-step workflow.

Multiple actions in one step

The same three actions could be separated into several steps.

Multiple actions in many steps

How you structure your workflow into steps depends on what you want each step to accomplish. The rules in one step are processed to conclusion before going on to the next step, so you want to group in the same step any rules necessary to effect the specific action or actions that you want.

More specifically, each step can hold one set of 'Else If' conditional branches, where the actions in each branch are performed only when the associated condition is satisfied. In this case, additional steps are needed only when:

  • Multiple sets of 'Else If' conditional branches need to be evaluated.
  • You need to separate a branched statement from a non-branched statement.

You can also use steps simply as a way to organize your workflow. For example, a workflow might have many actions in a step that doesn't use conditions. In this case, you might want to separate the actions into steps just to better organize them.

Top of Page TOP OF PAGE

What are workflow forms?

To make your workflow more dynamic and flexible, you can add a form to the workflow. With a form, you can collect information from workflow participants at predefined times in the workflow, and make it possible for participants to interact with the tasks for that workflow.

With Office SharePoint Designer 2007, you can create two types of workflow forms:

  • An initiation form gathers information from the workflow participant when they start the workflow. Initiation forms are displayed to users when they manually start a workflow on a given SharePoint item. With an initiation form, users can specify additional parameters or information about the workflow as it applies to the given SharePoint item. For example, you might use an initiation form to ask who should review a document and by when the review should be completed. Not all workflows need initiation forms. If you do need one, Office SharePoint Designer 2007 automatically generates an ASP.NET initiation form according to your initiation specifications.
  • A custom task form allows workflow participants to interact with tasks in the Tasks list on a SharePoint site. With the Custom Task Wizard, you can easily create custom form fields and add them to a custom task form. When you finish designing the workflow, Office SharePoint Designer 2007 automatically generates the ASP.NET forms for your custom tasks. Then, when the workflow runs and tasks are created, the user browses to the Tasks list on the SharePoint site, marks the task as completed, and enters any optional or required information specific to the workflow. The workflow can then respond to those changes as specified in the workflow, or look up and evaluate that information in later steps of the workflow.

After Office SharePoint Designer 2007 automatically generates the ASP.NET forms, you can customize them. Workflow forms are ASP.NET pages with a Data Form Web Part and a master page applied to it. These .aspx files are stored on the SharePoint site with the workflow source files. You can open and customize these forms as you would any other .aspx file.

Top of Page TOP OF PAGE

Where are workflows stored?

Workflows are stored in a site-level document library called Workflows. This document library is created automatically by Office SharePoint Designer 2007. In the Folder List, the Workflows document library displays the workflow icon instead of the usual list or document library icon. By default, the Workflows document library is hidden from the browser and has no List Views, such as AllItems.aspx or EditForm.aspx. This document library contains a folder for each workflow created with Office SharePoint Designer 2007. The folder contains all the source files necessary for the workflow, including:

  • The workflow markup (.xoml) file (needed only when the workflow uses conditions).
  • The workflow rules file.
  • The workflow configuration file.
  • Any .aspx forms needed, such as initiation forms (for workflows that are started manually) or custom task forms.

To modify an existing workflow, you can either click Open Workflow on the Filemenu or double-click the .xoml file in the Folder List. This opens the workflow to its first step in the Workflow Designer. If you click Back to view the initiation settings of the workflow, you see that you cannot change which list or library the workflow is attached to. After a workflow is attached to a list or library by using Office SharePoint Designer 2007, this association cannot be changed.

Workflows in folder list

The Workflow Designer provides an action called Log to History List. You might use this action when you want to keep a record of the workflow history for investigating errors or for tracking and repudiation purposes. When you create a workflow that uses the action Log to History List, Office SharePoint Designer 2007 automatically creates a list called Workflow History. This list has columns for such information as user ID, date, event, and error description. Like the Workflows document library, by default the History list is hidden from the browser but can be seen in the Folder List.

Workflow history in folder list

The Workflow Designer provides three actions that interact with the Tasks list: Assign a To-Do Item, Collect Data from a User, and Assign a Group Survey. When you create a workflow that uses any of these three actions, Office SharePoint Designer 2007 automatically creates the .aspx form, the content type for the task, and the Tasks list, if necessary. By default, the Tasks list can be viewed in the browser, unlike the Workflows document library and Workflow History list.

Tasks list in folder list

Top of Page TOP OF PAGE

Where can I check the status of a workflow?

You can easily view the progress of workflows on a selected item through the browser. The All Items view of a list or document library displays the current status of workflows running on an item. In addition, each item has a Workflows page where you can view the following information:

  • All workflows currently running on that item.
  • All workflows that have run on the item in the past.
  • All the available workflows for that item.

Workflows page for an item

To view the Workflows page for an item, click the item in the list, and then clickWorkflows on the menu.

NOTE   The Workflows command is available only when the item is in a list or library that has at least one workflow attached to it.

When a user starts a workflow on an item, Windows SharePoint Services 3.0 adds a new column to that item. By default, the column name matches the name of the workflow. This read-only column displays the current status of the item within that workflow. This status column is added automatically for each workflow the first time it is run.

Columns display workflow status

In each column, the workflow status is a link. When you click In Progress, for example, you see the Workflow Status page for that instance of the workflow.

Workflow status page

A workflow created in Office SharePoint Designer 2007 cannot be deployed to multiple lists. It is only valid for the list for which it was created. However, multiple workflows can be attached to one list and may be available for a given item. Multiple workflows can run simultaneously on the same list item, but only one instance of a specific workflow can run on a specific item at any given time. For example, you might have two workflows, Workflow A and Workflow B, available for a specific list. Although both workflows can run simultaneously on a specific item in the list, you cannot have two instances of Workflow A or Workflow B running on the same item at the same time.