.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

create custom timer job to start a workflow

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :SharePoint

i have created a project with visual studio, to start every day a workflow on every item in a list.

when i place my code in a webpart and i run the code on 1 item, the workflow will start normally.

when i place my code in the  timer job in the execute method, the timer job will finnish normally but there will be not workflow started.


public override void Execute(Guid contentDbId)

            SPWorkflowManager objWorkflowManager = null;
            SPWorkflowAssociationCollection objWorkflowAssociationCollection = null;

            using (SPSite mySiteCollection = new SPSite(siteurl))
                using (SPWeb mySite = mySiteCollection.OpenWeb())

View Complete Post

More Related Resource Links

How to create custom task form in state machine workflow?

Hi, I want to create custom task form in state machine workflow. How can I create & install?  G. Goyal

Start a workflow from timerjob on custom list

I have built a working custom workflow which works fine. I need to start this same workflow from timerjob on a custom list. The timerjob catches following error. Value does not fall within the expected range.Microsoft.SharePoint   at Microsoft.SharePoint.SPFieldMap.GetColumnNumber(String strFieldName)    at Microsoft.SharePoint.SPListItemCollection.GetRawValue(String fieldname, Int32 iIndex)    at Microsoft.SharePoint.SPListItem.GetValue(SPField fld, Int32 columnNumber, Boolean bRaw)    at Microsoft.SharePoint.SPListItem.GetValue(String strName, Boolean bThrowException)    at Microsoft.SharePoint.SPListItem.GetValue(String strName)    at Microsoft.SharePoint.SPListItem.get_EffectiveBasePermissions()    at Microsoft.SharePoint.SPListItem.DoesUserHavePermissions(SPBasePermissions permissionMask)    at Microsoft.SharePoint.Workflow.SPWorkflowManager.StartWorkflow(SPListItem item, SPWorkflowAssociation association, String eventData, Boolean isAutoStart) Any help on this will be appriciated. Thanks,    

Workflow - automatically create discussion item using title field of of custom list item as its subj

Anyone any ideas as to how I can configure SharePoint to create a discussion item using the title of a list item. e.g. user creates list item on a custom list - SP automatically creates a Discussion thread for this list item in the discussions list. I'm guessing this can't be down OOTB . would I be looking at SPD or a coded solution ? regards, Counie

custom workflow does not start


For some reason i can not start any of custom workflows created in SharePoint Designer 2010.

Those are very simple workflows updating just one field. I have checked in the admin console and user definded workflows are enabled.

Do I need to do anything else to get them working?

Also to be more precise i'm able to start those workflows manually - only automatic starts are issue when item is created or updated.

Can I create a timer job to run a custom code everyday?


Hello guys,

I have to run some calculations at sometime everyday through code in sharepoint. So How can i make sure that this code runs at particular time to perform those calculations.

If you guys know anything, let me know.


how to create a custom task content type for VS2008 workflow



i want to create a WorkFlow by VS2008 and i want to use custom content type for the tasks, and i want to build this cutome content type by Aspx form but i don't know how, any ideas ??


Thanks for all.

Custom Workflow won't auto start, but only for one user.


Hi, I have a custom worklfow which is associated with a list.  The workflow is set to auto start when a new item is added to the list.  This happens fine for every user in my organisation, but not for one particular user.  When he submits a new item to the list, nothing happens. The Workflow just will not start.  There are no errors in the log and no attempt is made to start the workflow.  The user is part of a SharePoint group which has contirbute (no delete) permission on the list, just like everyone else in that group who works fine. 

This user also is having problems progressing the workflow, if I start the workflow for him and assign it to him.

The workflow above, manages a CR process, creating tasks for users, taking their responses from custom task forms and populating a CR document held in a document library.  The first step for a user is to fill in a task form which when submitted, sets the task to 100% complete, then populates the CR document with the text the user entered.  Once the task is at 100%, the workflow process is looking for this, closes the task and creates a new task for an approver.  The problem for this same is user is that, the task gets set to 100%, but the CR doesn't progress.  Again, no errors are shown, but the tp_workflowversion value in the userdata table in the content datab

Custom Workflow Activity Works 'Manually' but can't be fired using CodePlex's 'Start Another Wo


Consider 2 lists.  In one list, a workflow runs on an item and if conditions are right, it creates an item in another list, pauses for 5 min, then starts another workflow on that newly created list item (using CodePlex's old 'Start Another Workflow' routine).

All of that works great, used it many times in many situations without fail, so long as I put a pause between the item creation and calling the workflow on the newly created item.

I've started writing my own custom workflow activities, all of them work just fine, up to 5 now, really useful to do little things that SPD Workflow can't do by itself.  The 5th one I added was a very simple 'Now' routine.  The class itself is called 'GetNow' and has a 'RightNow' property that's DateTime and it works great.  I have the need to stamp something with the current date/time, and I haven't modified the underlying record yet, and setting a Date/Time variable only takes Today or a static date/time, with 'Today' returning the current date, but '12 am', which is redunculous, but I digress.

So my step compiles, updated my .ACTIONS file which holds the definition for the other 4 custom routines.  I have the context 'in' parameter and one 'out' parameter for 'RightNow' defined as System.DateTime (which I think is where the problem is, possibly), and it all works if I

Create custom workflow using Managed Metadata and Sharepoint Designer


Hello all,


We have a very specific question from one of our customers concerning managed metadata and workflows that I can’t seem to figure out. Maybe you could give me a hand. This is the situation:


They want a taxonomy store with managed metadata. The departments of the customer are stored here (in a branched way). When a user adds an document to a document library he or she has to fill in the metadata field for the department so it will be connected to this document. Depending on the department they want to assign an approval task to a different manager.


Should I create a custom workflow or not?


I have a scenario where I want a user when viewing a list item to be presented with a custom action to create a site. This is pretty similar to the scenario provided in the MOSS 2007 SharePoint Guidance. What makes it different is that I want the site created with the url and name taken from the list item, and then a web propertybag value set. The only user task after the site is created is for the site collection administrator to add some specific user rights to it.

I can do everything apart from prompting the user to set the site rights via the object model so should I use a workflow or just code it straight?

How can i create a Custom Association Form for a workflow in visual studio?


I want to create a Custom Association Form for a workflow in visual studio, how can i do it?

I want to create a Custom Association Form with two buttons Acept and cancel.

Thank you.

Unable to create task using Custom task Process Action in Sharepoint Designer 2010 workflow

Problem : In Sharepoint Designer 2010, we are working on creating reusable workflow.
In workflow we are using "Start Custom task process" action. It has been observed that,all of the sudden it behaves weirdly. It creates task but without any number appending to taskform.for eg. when we create task it generally shows "Start Task(1) process on Current Item with these users" However now it does not provide any number with Task. It shows "Start Task process on Current Item with These users"
In task form , it does not allows to add task forms fields from existing fields nor allows to create outcomes.
Thus we are unable to create any new workflows or edit and enhance exisitng workflows in the site.This is showstoper for project. Client wants to use sharepoint designer exclusively to develop workflow.
When we tried to create workflow (Sharepoint designer) in a new site with new list it allows us to create custom tasks process. 
Resoultions approaches done so far.
1) Took backup of site on local box from Server and tried to create custom process task but not able to do it.
2) On Server removed all unwanted workflow status columns from the tasks list but still not able to create custom process task 
3) Took backup and t

Silverlight: Create a Custom Expression Encoder Publishing Plug-In


Laurence Moroney demonstrates how to employ the Expression Encoder plug-in APIs by building and debugging a simple FTP upload plug-in.

Laurence Moroney

MSDN Magazine February 2008

Fuzz Testing: Create a Custom Test Interface Provider for Team System


Dan Griffin shows the extensibility of Visual Studio 2005 Team Edition for Software Testers by discussing the modification of the existing Test Interface Provider sample in the latest Visual Studio SDK and implements Fuzz Testing.

Dan Griffin

MSDN Magazine November 2007

Smarter Art: Create Custom SmartArt Graphics For Use In The 2007 Office System


SmartArt incorporates a gallery of templates and predefined shapes that can quickly be inserted and configured in your Microsoft Office documents. Find out how.

Janet Schorr

MSDN Magazine February 2007

Desktop Security: Create Custom Login Experiences With Credential Providers For Windows Vista


Why is a change to the Windows logon plug-in interface so exciting? Because with credential providers you can customize the logon experience for your users.

Dan Griffin

MSDN Magazine January 2007

Windows Workflow: Build Custom Activities To Extend The Reach Of Your Workflows


This article covers the core components required for building custom activities in Windows Workflow Foundation.

Matt Milner

MSDN Magazine December 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend