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

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

How to get the Task (SPListItem) in the OnTaskCreated activity?

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


How to get the Task ( as SPListItem object) in the OnTaskCreated activity. The taskId used when creating the task isn't the uniqueId of the Task so using it in the


 _workflowProperties.TaskList.GetItemByUniqueId(Guid taskId)


 won't give me the SpListItem i need. The final gol is to set user permissions to the task.




View Complete Post

More Related Resource Links

Create task activity break out inside a While loop

Hi I have developed a sharepoint state machine workflow. I want to assign a same task to more than one users, but unfortunatly, I cannot give the attribute "AssignTo" to more users in the code, even like this:"this.workflowTask1Properties.AssignedTo = "mydomain\\user01;mydoman\\user02", that will result in an empty value to the attribure.So, I involved the createtask activity in a While loop so I can asign deferent user in each loop, but It's very stange,  the loop always stopped in the second time, does anybody have met this issue?I have referensed Amit's question:http://social.msdn.microsoft.com/forums/en-US/windowsworkflowfoundation/thread/b238978d-f330-420c-823e-b77b0e19414d?prof=requiredbut I have no define the "correlation refernce " in my workflow.my code is here:public SPWorkflowTaskProperties workflowTask1Properties;public int abc;...private void OnWorkflowActivated(object sender, ExternalDataEventArgs e)        {            ...           this.abc = 0;           ...        }...private void CreateTask1(object sender, EventArgs e)        { 

SPListItem "Start Time" for recurring events when building a task reminder Timer job.


I have a timer job that looks at maintenance events (calendar list) planned 5 days in the future and moves them to the current todo list. It then marks that maintenance item as copied so it is not double copied to the current todo list.

This works good for single event maintenance items but not for routine or recurring maintenance items. The reason is the recurring events have a "start time" of the first event so after the first one gets moved the rest are all interpreted as being in the past, since (I think) the recurring events start time is generated as an offset of the original event at runtime. How would I get a collection of ALL the Event items that are 5 days out (single and recurring) within a timer job.




Expanded recurrence items cannot be updated

Task reassignments using UpdateTask Activity



I'm trying to reassign the task by using UpdateTask activity after OnTaskChanged activity and it works, BUT MOSS shows me the error page with "Task update was not accepted." error message. Anyone have some ideas, maybe there is a better way of task reassignment ? Several days of googling have brought no results and if you could send me a working example you would save my life (mssemyonov_amp_yahoo.com).


If I'm changing my workflow so that UpdateTask activity is running after OnWorkflowItemChanged everything works fine without errors, I think there is something wrong with OnTask

Using a Create Task Activity inside a While loop



I have developed a sharepoint sequential workflow. It consists of a while loop, inside which there are 2 activities (in a sequence)-

1. Create task activity

2. Code activity

Code activity is used to set the test condition of the while loop.

The loop executes successfully on the first iteration. But on the subsequent iterations, an error occurs in the workflow.

My requirement is to create the task repeatedly as long as while loop doesnt exit. Is this possible? Any suggestions would be valuable.



Parallel Debugging: Debugging Task-Based Parallel Applications in Visual Studio 2010


In Visual C++ 10 and the Microsoft .NET Framework 4, Microsoft is introducing new libraries and runtimes to significantly ease the process of expressing parallelism in your code base, together with new tool support for performance analysis and debugging of parallel applications. In this article, you will learn about debugging support in Visual Studio 2010, much of which is focused on task-based programming models.

Stephen Toub, Daniel Moth

MSDN Magazine September 2009

Windows with C++: Task Scheduler 2.0


The new Task Scheduler in Windows Vista can do so much more than previous versions. We introduce some basic concepts and building blocks you can put to use in your own scheduled task projects.

Kenny Kerr

MSDN Magazine October 2007

Cutting Edge: Simplify Task Progress with ASP.NET "Atlas"


Dino Esposito rewrites his task progress bar with the help of ASP.NET "Atlas."

Dino Esposito

MSDN Magazine October 2006

Cutting Edge: Reporting Task Progress With ASP.NET 2.0


The progress bar is great for keeping users informed about the progress of a task. Unfortunately, there's no progress bar element built into ASP.NET, so Dino Esposito solves that problem with his ProgressPanel control.

Dino Esposito

MSDN Magazine September 2006

SQL Server and DMO: Distributed Management Objects Enable Easy Task Automation


SQL Server can be administered programmatically using system stored procedures, but Distributed Management Objects (DMO) offer a more modern, object-oriented alternative. This article introduces SQL-DMO in SQL Server 7.0 and SQL Server 2000 and describes the SQL-DMO object model, then focuses primarily on the Databases tree and the JobServer tree of the object model. The sample code and the article show how to use various objects such as the Registry object, the Configuration object, and the Database object to automate common administration tasks such as programmatically retrieving configuration settings, creating new databases, applying T-SQL scripts, and creating and scheduling backups.

Francesco Balena

MSDN Magazine May 2001

A Simple XML-driven Tool: Monitor Your Web Site's Activity with COM and Active Scripting


This article describes a simple Web site monitoring tool built with XML, JScript, Windows Script Host, and COM objects. Although it is not intended to replace complete Web site monitoring software products, it has many useful features that help to keep Web servers up and running. An XML configuration file specifies which Web sites to monitor and the actions to be taken if the site isn't functioning properly. In addition, the tool can be scheduled to run at any specified interval using the Windows Task Scheduler. Functions that probe the sites, log events, and send e-mail notifications are written in JScript.

Panos Kougiouris

MSDN Magazine July 2000

create Scheduled Task that auto send mails


hello every one

i bought a hosting plan that allows me to send about 500email/per hour

but my client wish to send about 2000 or 3000 email at a time

is there a way to split them and 500 email per a time automaticly without the need of reloging again every hour

my hosting plan doesn't allow me to create a sql jop or send mails via Sql Server.

any bright ideas ?

Convert .docx to web page - "the converter cannot complete the task because an internal error occurr


I'm trying to convert docx files to webpages to be published in to a library elsewhere on our sharepoint site. At first I was having no problem, the files were converting, however more recent files have returned the error: the converter cannot complete the task because an internal error occurred

I've tried writing, uploading and converting a simple docx file, and this works which has led me to believe that the problem is something in the docx files that i'm trying to convert. So i tried using word07 to clean the documents up by clicking Office button>prepare>inspect document then removing all the metadata, custom xml etc from the files resave, upload and convert, but still no joy.

I'd simply rewrite the document but the problem is that there are a lot of them.

Any ideas what's going wrong?


Attach Workflow to Task List, don't get option to manually start workflow via dropdown on task item



I am running WSS 3.0 with other workflows which are functioning correctly.  I created a new workflow in Visual Studio 2008 and was able to successfully run it in my dev environment.  I attached the workflow to a task list in my dev environment and was able to manually start the workflow by using the drop down workflow option and using the menus to manually start it.  I installed this workflow in our production environment and attached it to the task list (which had a SPD workflow attached to it which stopped working about a month ago).  I made sure that the option to manually start the workflow was checked.  When I tried to manually start the workflow, (hover mouse over title, drop down) there isn’t a workflow option.  The workflow also will not start automatically when a task is changed.


I attached this same workflow to a different task list in production and get the option to start it.


I have tried creating a small workflow in SPD 2007 and attaching it to the task list.  It shows that it is attached, when I look at the workflows that are attached to the task list, but I still don’t get the option to manually start it.


I have checked my security and I have fu

How to make the Workflow Status remain "In Progress" when a task is "Rejected"


Hi Sir/Mam,

I have a work flow running on a list, when a task is Rejected at a stage then the Workflow status is set to "Completed". Instead of this I want the Status to remain as "In Progress", so that in future after the modification of the document the Approver may Approve it and then take it to the next stages. This is not possible if the Workflow is set to "Completed".

Can you please suggest an easy way to do this

Thanks in Advance


Updating Task Lists and Form Libraries From Workflow Form


There are actually two separate (I think) problems here. The scenario: I used the SharePoint Designer 2007 to create a workflow attached to a form library. When a form is submitted to the library, a To-Do-Item is created on a task list. The To-Do-Item is initially assigned to a GROUP. A user from the group then selects the name of an individual from a choice list in edit item. This person now becomes the Assigned To for the task.

What is needed is 1) To update the Assigned To column of the Form library when someone in the GROUP assigns the task to an INDIVIDUAL; and 2) To have the Due Date from the submitted InfoPath form propagate to the task list.

I've tried having one workflow try to do everything and also having a secondary workflow set up on the task list to do the task assignment update but have not been successful in solving either issue. I don’t think that I am really understanding how to Define Workflow Lookup when not working with the Current Item. I know what fields I want but I don’

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