Showing posts with label SharePoint 2007. Show all posts
Showing posts with label SharePoint 2007. Show all posts

Saturday, June 19, 2010

Starting a Workflow from an Event Receiver - SharePoint 2007

Out of the Box there are only a few options to start a (custom) workflow. E.g. when an item is created or changed. This means that there are a lot of situations that a workflow is fired where it is not needed (often a workflow only needs to be started if a field has a specific value). Therefore we can write an event receiver to time better when a workflow is started. Below you find the code to start a workflow from your event receiver.

[code:c#]

public override void ItemUpdated(SPItemEventProperties properties)

{

if(YourCondition)

{

SPList parentList = properties.ListItem.ParentList;

SPWorkflowAssociation associationTemplate =

parentList.WorkflowAssociations.GetAssociationByName("Workflow Name",

new CultureInfo

(Convert.ToInt32(parentList.ParentWeb.RegionalSettings.LocaleId)));

SPSite siteCollection = properties.ListItem.ParentList.ParentWeb.Site;

siteCollection.WorkflowManager.StartWorkflow(properties.ListItem,

associationTemplate, String.Empty);

}

}

[/code]

Monday, January 18, 2010

Installing Project Server 2007 on Windows Server 2008

If you try to install Project Server 2007 on Windows Server 2008 with Service Pack 2, the Setup program will give you an error message such as this one:

“The program is blocked due to compatibility issues.”

The solution for this error is the same as the solution for a similar error with SharePoint Server 2007 – you need to slipstream the latest service pack files into your Project Server installation (the SharePoint solution was described by Martin Kearn here.)

To successfully load Project Server 2007 on Windows Server 2008 SP2, follow these steps:

1. Copy Project Server 2007 installation files from the CD to a local directory on your hard drive, such as C:\Project2007.

2. Download Project Server 2007 SP2 files from this location:

http://www.microsoft.com/downloads/details.aspx?FamilyID=b7816d90-5fc6-4347-89b0-a80deb27a082&displaylang=en.

Choose the appropriate download for your architecture (32-bit or 64-bit).

3. From the command prompt, extract the update files to a local folder using /extract switch. Example: c:\ProjectServer2007sp2-kb953334-x86-fullfile-en-us.exe /extract:c:\Project2007SP2\

4. Copy the extracted SP2 files to /Updates directory in the Project Server 2007 installation folder on your hard drive.

5. You can now install Project Server 2007 on Windows Server 2008 SP2.



Source: http://sharepointnomad.wordpress.com/2009/09/16/installing-microsoft-office-project-server-2007-on-windows-server-2008-sp2/

Update:  the link above now contains SharePoint 2007 SP2 and it applies for Project Server 2007 as SP2 too, and the command will be: officeserver2007sp2-kb953334-x64-fullfile-en-us.exe /extract:c:\Project2007SP2\