.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

a error when update a workflow task item

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

I get a error when I want to update a task.



               Hashtable taskHash = new Hashtable();
               taskHash["TaskStatus"] = "1";
               SPWorkflowTask.AlterTask(m_task, taskHash, true);

error message:

Object reference not set to an instance of an object.   at Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(Guid newGuidOnAdd, Boolean bMigration, Boolean& bAdd, Boolean& bPublish, Object& objAttachmentNames, Object& objAttachmentContents, Int32& parentFolderId)
   at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents)
   at Microsoft.SharePoint.SPListItem.Update()
   at Microsoft.SharePoint.Workflow.SPWorkflowTask.AlterTask(SPListItem task, Hashtable htData, Boolean fSynchronous)
   at SSC.SAM2.Workflows.TaskPages.TaskPageCode.BtnComplete_Click(Object sender, EventArgs e)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.

View Complete Post

More Related Resource Links

Access Denied error on custom workflow task list item


We have created a two level custom approval workflow on (an InfoPath) form library using SharePoint Designer (SPD) with first and second approver. The workflow works fine as long as the approver is in the Site Collection Administrators group. The approvers who are not in the admin group can get to the custom Task form for approve/reject, but they can only view the form. When they click on the “Edit Item” button of the task list item, they receive “Access Denied” error. We have given these approvers “Approve”, “Contribute” permissions on the Form library and even Full Control on the task form list (all items). Note: The users use their domain account and the error they are getting is: Access Denied, You are currently signed as DomainName\LoginName, Sign in as a different user.

We have read through several forums and have found people having the same issue. We tried all of the suggestions described in the following links - but no success so far.

SharePoint Designer Workflows, Tasks, and the Annoying “Access Denied” Error

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

Workflow Task And Relevant List Item


Hello there...

1. What is the name of  the field thats connect between the task item and  the list name or guid and the list item id or guid

2. SPD: how can when starting the workflow how can i ensure that the initial form variables will be saved at the workflow task list

Many Thanks



Update workflow task


Hello guys,


I created a timer job service to send reminders when a task is overdue, now I am looking at how visible it is for reassigning the task to some one else within the timer job service itself.


Is this possible?



Access Denied/The workflow could not copy the item workflow error after Sharepoint 2010 upgrade

We have a sharepoint designer workflow that copies a document from one library to another on the same site.  Before the upgrade to 2007 it worked fine, but now with 2010 it gives an error and cancels the workflow when it gets to the copy list item step.   The error on the workflow page: The workflow could not copy the item. Make sure the source and destination lists have the same columns and column settings.  Access Denied   Specifically it is the "copy list item current item to documentlibrary" sharepoint designer workflow action.   I have given the system account full permissions to the library and double checked that all columns are the same in both libraries. These are the verbose trace logs:   09/01/2010 09:46:04.05 w3wp.exe (0x17C4) 0x093C SharePoint Foundation Workflow Infrastructure 72er Medium System.UnauthorizedAccessException: <nativehr>0x80070005</nativehr><nativestack></nativestack>Access denied. at Microsoft.SharePoint.SPFile.UpdateInternal(Boolean migrationSemantics, Boolean reGhost) at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitCopyFile(Transaction txn, Object[] transData) 09/01/2010 09:46:04.05 w3wp.exe (0x17C4) 0x093C SharePoint Foundation Workflow Infrastructure 72fe High Error in commiting pending workflow batch items: Sys

Workflow Task UpdateRoleAssignment Error

Hi,  I’ve got a problem with a Sharepoint Workflow. The workflow run very well in most conditions, with different data, in different installations, systems, but sometimes, the workflow throws an error and stop working. The stack trace is: Operation aborted. (Exception from HRESULT: 0x80004004 (E_ABORT))    in System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation)    in System.Workflow.Runtime.WorkflowExecutor.ProtectedPersist(Boolean unlock) Operation aborted. (Exception from HRESULT: 0x80004004 (E_ABORT))    in Microsoft.SharePoint.Library.SPRequest.UpdateRoleAssignment(String bstrUrl, Guid& pguidScopeId, Int32 lPrincipalID, Object& pvarArrIdRolesToAdd, Object& pvarArrIdRolesToRemove)    in Microsoft.SharePoint.SPRoleAssignmentCollection.UpdateAssignment(Int32 principalId, SPRoleDefinitionBindingCollection bindings, Boolean addOnly)    in Microsoft.SharePoint.SPRoleAssignmentCollection.Add(SPRoleAssignment roleAssignment)    in Microsoft.SharePoint.Workflow.SPWinOETaskService.CommitTask(Transaction txn, Object[] transData)    in Microsoft.SharePoint.Workflow.SPPendingWork.PerformWorkNow(Transaction txn)    in Microsoft.SharePoint.Workflow.SPPendingWorkBatch.Commit(Transaction transaction, ICollection items) &nbs

OOTB Approval Workflow SharePoint 2010 - Blank "Requested By" field appears in Task Item edit/view f



I am having a simple OOTB  approval worflow associated to the simple document library. Task is created when an document is uploaded to the library.  When I click the task item in task list, I see a blank field "Requested By"  right below the "Status" column and I am unable to understand from where this field is coming and how to populate this field. Any help would be great...

Update Approval Workflow task status


Hello All

I am trying to update the task status automatically after a list item is approved without much luck. I need to set the task status to "completed" without having to manually hitting the "complete task" button, so the next person in line can approve the list item.

How can I change the status of a task using SharePoint Designer 2010?

In my SharePoint Designer task editor I have:


if Current Item:Approval Status equals 0;Approved

---I need to add a line in here that updates the task status to "completed"

Assign Approve list item to User2



Thank you all in advance.



SharePoint Workflow: random error task rollback


I get "Reason: The user who attempted to complete the task is not the user to whom the task is assigned." as the error occured, but this only happens randomly, roughly 50% of the workflows error out with above error with no apparent rhyme or reason as to what causes it to error.

Notice creation by a secretary fires off the workflow, which then gets approved by the attorney, and then it errors with above message, but only 50% of the time and in apparently random order.

SharePoint 2010 Enterprise, SQL Server Enterprise R2

Approval Workflow : Getting the name (or unique ID) of the item being approved in the infopath Task


I need to display the name/title of the item being approved in the infopath task form that is viewed by the approvers. How can I achieve this? The data fields in the Primary data connection seem to correspond to task item and not the item being approved itself.

Thanks in advance!

update item in list by workflow on list in other site



is it possible to update/insert item in the list of other site (other then the site on which workflow is running)?

Please advice.


task item not able to update custom list item


I have a site with NT authenticated users with READ permission only.

  • I have custom list 1 with disinherited permissions where users can add items. A column in this list captures the name of the persons Manager (person or Group). e.g item created by Person X
  • WorkFlow runs and copies the item from custom list 1 to custom list 2
  • Custom List 2 with disinherited permissions. The item continues to have Person X in the 'created by' column
  • WorkFlow runs on Custom List 2 assigning only contribute permission on Custom List 2 to the Manager entered in the item. Person X has no access to the item in Custom List 2
  • The WorkFlow has  a Collect Data From User task to be completed by the Manager. The WF runs and creates the Task in the task list. I've noticed that this item in the task list is created by Person X!
  • The Manager completes the Task successfully. Then Custom List 2 is supposed to get updated with the values the manager set in the Task.
  • The Manager has contribute permission on the item in Custom List 2, so they should be able to update the item, but the WF fails with either Access Denied, or unable to find item or some such.

Copying approval from Workflow task to List Item.


I have a system for entering info into sharepoint.  When the info is first entered, the list info is sent to the manager for approval using the workflow approval process.  This work, the email goes through, and then is approved on the workflow, but we have the require content approval checked, and this approval stays on pending.  I am trying to do a look up on the task list, and then approve or reject based on that.  It is not working.  The If statement always is ok, and then it is approved, even if i set reject.  Can anyone help me with this?


For the workflow lookup, the Field Data to Retrieve is

DataSource is the Tasks list for the workflow

Field from source is Approval Status


The Find the list Item is

Field is Workflow Item ID

Value is Current Item:ID


I am using this info to try to pull the approval status of the workflow and then based on

that set the approval of the list item.



Publishing Site - Task update was not accepted error



In a Publishing Site, I am trying to create a Site (Site Actions -> Create Site).  While Approving the newly created Site, I get a Error Page which says "Task update was not accepted".  I don't see any additional information in the logs?

I am using SharePoint 2007 Enterprise.  Anyone faced this problem? Please advice.

Thanks & Regards,
Kamlesh | Blog | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.

How to update workflow task and terminate workflow using silverlight client object model.



I have created a sequential workflow using visual studio. I also created a content type inherited from the workflow-task content type. Workflow creates a task-item in the task list. I want to update the workflow task using the silverlight client object model. I find on the internet and WorkflowTask.AlterTask() method to update the workflow task item. But I didn't find the equivalent of WorkflowTask.AlterTask(). Can any one help me to update the workflow task from the silverlight client object model?

I also want to terminate the workflow instance using silverlight client object model, but i didn't find any way to terminate the workflow using client object model?

Creating a custom Workflow + Custom workflow task + complete = error


Hi everyone,

I am using a custom workflow in SharePoint 2010, with one task in it using a Custom Content type deriving from the "Workflow Task" type, with a custom Edit form.

From this point everything is fine, I can create my Task, open it from the task list with my custom webpage as form, but when I want to update my task to complete it, i get a very weird message that I didn't find any help about: "The workflow's parent item associated with this task is currently in the recycle bin, which prevents the task from being completed".

I Just have my Custom workflow using a Custom Workflow task, I don't see where this should come from... I even looked in the Recycle Bin, but it was empty as I was thinking it would be...

Any chances someone got a solution on this?

Cheers, Ben

create task item with sharepoint designer workflow



I have an InfoPath form and a SharePoint forms library with a workflow. When I submit an InfoPath form to the forms library a workflow is triggered. Within this workflow I want to create an item in the task list. This is possible with the action in sharepoint designer wf "assign a to do item". But within this action the name of the task item is hardcoded.

Now I want to change the name of the task item. The name should be one field of my InfoPath form. I also want to set the due date of the task item.


Any ideas?



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