Tasks get completed but workflow Status shows 'Error Occured' and not 'COmpleted' in Sequential Workflow Visual Studio 2010

I have a custom approval sequential
private void completeSPTask_MethodInvoking(object sender, EventArgs e)
SPListItem task = workflowProperties.Web.Lists["Workflow Tasks"].GetItemById(WfApproveTaskItemId);
task[SPBuiltInFieldId.WorkflowVersion] = 1;
task["Status"] = "Completed";
task.SystemUpdate(false);
if (task["Status"].ToString() == "Completed")
Hashtable HTdata = new Hashtable();
// HTdata["Status"] = "Completed";
// HTdata[SPBuiltInFieldId.Completed] = "TRUE";
HTdata[SPBuiltInFieldId.PercentComplete] = 1;
HTdata["FormData"] = SPWorkflowStatus.Completed;
// HTdata[SPBuiltInFieldId.TaskStatus] = SPResource.GetString(new CultureInfo((int)task.Web.Language, false),"WorkflowTaskStatusComplete", new object[0]);
SPWorkflowTask.AlterTask((task as SPListItem), HTdata, true);
task.Web.Update();
workflow which works properly, the task status gets completed
When the tasks are 'In Progress' the workflow status also remains "In Progress" but when the task is completed , it shows error Occurred. The following is my code in CompleteTask method.

I got it working by removing the complete task method and by updating the task in the ontaskchanged event , In that case both the task as well as the workflow gets updated

Similar Messages

  • ITunes showing error 29 and not updating iOS help me please

    iphone 4s  showing apple symbol so i tried to connect to itunes .iTunestrying to update but later  showing error 29 and not updating iOS help me please.

    Read this - it should help
    http://support.apple.com/kb/TS5254?viewlocale=en_US

  • I can't upgrade my iPhone 4 to iOS 5.1.1 from the iPhone using wifi!! the installation start but before finishing an error occurred and the installation stop! help

    I can't upgrade my iPhone 4 to iOS 5.1.1 from the iPhone using wifi!! the installation start but before finishing an error occurred and the installation stop! help

    I will try, and what happen is that after it is intall and start "Preparing upgrade" the installation stop and a message occure: An error occure download the iOS 5.1.1" thas all.
    But now it is too late because the iOS 6 is now availabel, is it recommendet to donwload iOS 6 on iPhone 4 or not?

  • How do I resolve error 1310 while installing crystal report version for visual studio 2010.

    How do I resolve error 1310. I try to install crystal version for visual studio 2010, but I got this error message. Error 1310. Error writing to file. mcf80.dll.verify that you have access to that directory. My pc is window 7 (32 bit). Please I need help
    urgently to work with this program in my system successfully. Please help.

    Hello Dorohidea,
    Do you mean that when you install crystal report in virtual studio 2010, you receive the error message about error 1310?
    Please take a look at the following KB.
    Support for Crystal Reports for Visual Studio
    https://support.microsoft.com/kb/317789/en-us
    In Visual Studio 2010, to create a Crystal Reports project or Web site or to import existing projects or Web sites that were created by using older versions of Visual Studio or Crystal Reports, you must first install a version of Crystal Reports that is
    compatible with Visual Studio 2010.
    For more information about how to use Crystal Reports in Visual Studio 2010, visit the following SAP Crystal Reports website:
    http://www.sap.com/crystalreports/vs2010
    Best regards,
    Fangzhou CHEN
    Fangzhou CHEN
    TechNet Community Support

  • I can no longer get radio streams on my Apple TV.  I get a message saying that an error occurred and to please check again.  I have been using them for months successfully.  Any suggestions?

    I can no longer receive the audio streams under "computer" on my Apple TV.  Instead I get an error message and suggesting I try again.  This is true for all of the stations.  Any suggestions how to address this?

    Hi there,
    You're running an old version of Safari. Before troubleshooting, try updating it to the latest version: 6.0. You can do this by clicking the Apple logo in the top left, then clicking Software update.
    You can also update to the latest version of OS X, 10.8 Mountain Lion, from the Mac App Store for $19.99, which will automatically install Safari 6 as well, but this isn't essential, only reccomended.
    Thanks, let me know if the update helps,
    Nathan

  • Odd issue with message tracking. (User's emails show as SUBMIT and not SEND. No Byte Size) Exchange 2010

    Hi everybody.
    I had been tasked with tracking down a user's emails.
    I ran a script in powershell to export data I could work with.
    For some reason this particular user's emails in this time range do not show up as the EVENTID "SEND".
    They also do not have a Byte Count nor a list of recipients.
    They only seem to show up as "SUBMIT"
    Apparently this user has been sending out emails with a large amount of BCCs.
    Is there any way to actually see this activity? Why would it be showing up as SUBMIT and not SEND? Why won't it show any recipients or byte count?
    Here is my example script.
    Get-MessageTrackingLog -ResultSize Unlimited -Server "contoso-ex1" -Start "5/1/2014 12:01:00 AM" -End "5/8/2014 6:40:00 PM" | Select Sender,{$_.Recipients},{$_.RecipientStatus},MessageSubject,TimeStamp, EventId, Source,SourceContext,MessageId,InternalMessageId,ClientIP,ClientHostName,ServerIP,ServerHostName,ConnectorId,TotalBytes,RecipientCount,RelatedRecipientAddress,Reference,ReturnPath,MessageInfo
    | Export-Csv .\MessageTrackingLog.csv
    Please note that only this one user's emails are showing only as SUBMIT. The rest are mostly SEND.
    MCSE 2003, Exchange. MCTS Vista, 7. Administrator of awful, neglected website http://timssims.net

    Hi,
    I’d like to double confirm the question: This issue occurred only on one specific user in a particular time range.
    In other time, the message tracking shows correctly information for this user.
    I suggest we check the application log during that time range and see whether there are any related event IDs about this user.
    Thanks,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Simon Wu
    TechNet Community Support

  • I have adobe starter edition 3.2.I now get a message that a runtime error occurs and it won't open.

    I have a great number of fotos in this program. How can I save the fotos and get the program to open?
    I don't understand the runtime error message that appeared suddenly.

    Ouch!  That's one of the many reasons I detest applications that run on a library or catalog paradigm and hide your files where you can't access them externally.  They get discontinued, and the user is left hanging.
    Yes, Photoshop Album Starter Edition has been discontinued for many years.
    You don't specify your platform, but if you happen to be on a Mac, you could try extracting your images with File Juicer.  It will extract any and all images it finds inside any kind or type of file.
    http://echoone.com/filejuicer/
    Hopefully the Windows experts here can point to a Windows equivalent.

  • I wanted to do un up-date on my iPhone 4s, but it said an error occurred and it said i have to restore it and lose all my data. I just want my phone back, no up-date, with all my pictures. Please, can i do this??

    I do not want to restore my phone!

    If by 'un up-date' you mean you want to go back to a previous version you can't as its not supported by Apple.
    As for the error message what did it say?
    If you didn't make a backup before doing whatever it is you are trying to do then your photos are likely lost.

  • Error while saving the custom list created in visual studio 2010

    Dear all,
    when I am saving the list; I am getting the following error. I do not know where this could be wrong.
    Any inputs will help. Now I am recreating a new list - thinking that the objects used in the earlier projects might conflict. Also few lists in the list tab - were throwing error of the same type - which is not functioning well.
    warm regards,
    sathya

    To give more information on the code
    Registration list
    //Reference this Feature's parent object, which is SPWeb in this case
    SPWeb currentWeb = properties.Feature.Parent as SPWeb;
    //Reference the lists we need to manipulate.
    SPList tList = currentWeb.Lists["TrainingTrainers"];
    SPList rList = currentWeb.Lists["TrainingRegistration"];
    //Reference the fields in the lists
    SPFieldCollection rFields = rList.Fields;
    SPFieldCollection tFields = tList.Fields;
    //changes to the Trainers List
    SPField fullNameField = tList.Fields["Full Name"];
    SPField emailAddressField = tList.Fields["E-mail Address"];
    SPField firstNameField = tList.Fields["First Name"];
    SPField lastNameField = tList.Fields["Last Name"];
    fullNameField.Required = true;
    emailAddressField.Required = true;
    firstNameField.Required = true;
    lastNameField.Required = true;
    fullNameField.Update();
    emailAddressField.Update();
    firstNameField.Update();
    lastNameField.Update();
    //Changes to the Registrations List
    //Change the Display Name of the Title Field
    SPField titleField = rFields["Title"];
    titleField.Title = "RegistrationID";
    titleField.Update();
    //Add additional fields as necessary
    rFields.Add("First Name", SPFieldType.Text, true);
    rFields.Add("Last Name", SPFieldType.Text, true);
    rFields.Add("E-mail Address", SPFieldType.Text, true);
    rFields.Add("Phone Number", SPFieldType.Text, false);
    rFields.Add("ClassID", SPFieldType.Text, false);
    rList.Update();
    //Make the ClassID column read-only because i will set this later
    SPField classIDField = rList.Fields["ClassID"];
    classIDField.ReadOnlyField = true;
    classIDField.Update();
    //Remove the Attachments column from the default view of the Trainers list
    SPView tDefaultView = tList.DefaultView;
    tDefaultView.ViewFields.Delete("Attachments");
    tDefaultView.Update();
    //Add new fields to the default view of the Registrations list
    SPView rDefaultView = rList.DefaultView;
    rDefaultView.ViewFields.Delete("Attachments");
    rDefaultView.ViewFields.Add("First Name");
    rDefaultView.ViewFields.Add("Last Name");
    rDefaultView.ViewFields.Add("E-mail Address");
    rDefaultView.ViewFields.Add("Phone Number");
    rDefaultView.Update();
    Classes list
    //Reference the newly created Classes list and perform the following
    //1. Set the display name of the "Title" column to "ClassID" and hide it from the New and Edit Forms
    //2. Make the "ClassID" column not required
    //3. Set the default value of the Registrations column to 0 and do not display it on the new form
    //4. Add the built-in "Start Date" and "End Date" columns
    //Reference the newly created classes list
    SPWeb currentWeb = properties.Feature.Parent as SPWeb;
    SPList classesList = currentWeb.Lists["Classes-List"];
    //Title column update
    SPField titleField = classesList.Fields["Title"];
    titleField.Required = false;
    titleField.ShowInNewForm = false;
    titleField.ShowInEditForm = false;
    titleField.Title = "ClassID";
    titleField.Update();
    //Registrations column updates
    SPField registrationField = classesList.Fields["Registrations"];
    registrationField.DefaultValue = "0";
    registrationField.ShowInNewForm = false;
    registrationField.Update();
    //Add the Start Date and End Date columns to the list, ensure they both display Date and Time, and add them to the default view of the list
    SPFieldDateTime startDate = currentWeb.Fields["Start Date"] as SPFieldDateTime;
    startDate.DisplayFormat = SPDateTimeFieldFormatType.DateTime;
    SPFieldDateTime endDate = currentWeb.Fields["End Date"] as SPFieldDateTime;
    endDate.DisplayFormat = SPDateTimeFieldFormatType.DateTime;
    classesList.Fields.Add(startDate);
    classesList.Fields.Add(endDate);
    SPView defaultView = classesList.DefaultView;
    defaultView.ViewFields.Add(startDate);
    defaultView.ViewFields.Add(endDate);
    defaultView.Update();
    classesList.Update();
    To my sense - when I add the classes list - the error pops up.
    the classid is tied to both these lists.

  • I try to restore ipad to ios 7.0.4 but the tunes show error ,the ipad could not be restore because the firmware file was corrupt, i have the latest update from itunes and windows and i turn off antivirus and firewall and the error is the same , what i do?

    i try to restore ipad to ios 7.0.4 but the tunes show error ,the ipad could not be restore because the firmware file was corrupt, i have the latest update from itunes and windows and i turn off antivirus and firewall and the error is the same , what i do?, my ipad is show apple logo
    please what i do

    Hello JD_NINJA,
    Thanks for using Apple Support Communities.
    Error 9006 when restoring your iOS device indicates that there is security software on your computer which is preventing connection to the Apple server or your device.  To troubleshoot this issue please follow the directions below.
    Check your security software
    Related errors: 2, 4, 6, 9, 1611, 9006. Sometimes security software can stop your device from communicating with either the Apple update server or with your device.
    Check your security software and settings to make sure that they aren't blocking a connection to the Apple servers.
    Get help with iOS update and restore errors - Apple Support
    When restoring your iPhone, please make sure to follow the directions in the link below to properly restore.
    Restore your device from an iCloud or iTunes backup - Apple Support
    Take care,
    Alex H.

  • I am getting error (-1) while updating my iPhone 4 to iOS 5.1. The phone has gone into a recovery mode. Restore fails every time at "restoring the firmware" stage. Striped bar remains for a long time, then shows "error (-1)" and the restore fails. Help!

    I am getting error (-1) while updating my iPhone 4 to iOS 5.1. The phone has gone into a recovery mode. Restore fails every time at "restoring the firmware" stage. Striped bar remains for a long time, then shows "error (-1)" and the restore fails. I have been doing it for last 12 hours. Help!

    Thanks for your reply Michalo. I am in India and here Apple care does not work on Sundays. I have been without my phone for the entire day. Perhaps tomorrow will bring some respite. There is not solution to "error (-1)" on any forum it seems. I found one forum which suggested use of Tiny Umbrella. Any idea about that?

  • I have the mini display port cable to hdmi.  When I connect I can get audio but on the video I get the display auro screen and can't get my actual display to show as that is not what shows on my display.  How can I fix this?

    I have the mini display port cable to hdmi.  When I connect I can get audio but on the video I get the display auro screen and can't get my actual display to show as that is not what shows on my display.  How can I fix this?

    System Preferences>Displays
    There is a little white bar. When you have your TV connected, move the white bar to the other display. Your main desktop is now the TV screen

  • TS3694 Since last few months i am trying to update my ipad from iOS 3.2.2 to 4.1.2 or 5.1, but it always shows error 3002, 3194 etc. I have cheched& resorted to all the given troubleshooting steps , but they didn't help.

    Since last few months i am trying to update my ipad from iOS 3.2.2 to 4.1.2 or 5.1, but it always shows error 3002, 3194 etc. I have checked & resorted to all the given troubleshooting steps , but they didn't help.
    Somebody please help me

    Connect the iPad to iTunes, and do the update with iTunes.
    The 4.1.2 ipsw file will not work, no longer supported.
    The incremental update directly on the iPad does not work either, unless you are already on iOS 5.
    Let iTunes do the job, you already lost too much time by doing it yourself.

  • HT1527 itunes has been downlaoded in laptop in vista. but it is showing error

    itunes has been downlaoded in laptop in vista. but it is showing error.!!!!!!!!!!!!!!!!!!!!!!!!

    That's unfortunate.
    If/when you are ready for help, provide some details of the issue like the actual error message.  We are not mind readers.

  • My ipod touch will not restore backup files, it gets to 4 mins then say error occurred (-1),I have restarted my pc but no joy.

    My ipod touch will not restore backup files, it gets to 4 mins then say error occurred (-1),I have restarted my pc but no joy.

    I would next try restoring from backup.

Maybe you are looking for

  • Lenovo e330 touchpad problem on ubuntu 12.04 LTS (32 bit)

    dear all, i've installed ubuntu 12.04 LTS 32 bit on my lenovo e330. everything almost fine, but my touchpad. everytime i tap to click on th touchpad, the pointer shifted a little bit to the other direction. that's not what i want... the pointer is ok

  • Problem with installing Solution Center for a HP Photosmart Premium All-in-One Printer - C309g

    Hi folks, I've searched many threads and found some directions to remedy this, tried them and have had no luck. I'm running Windows 7.  All updates are current.  When I bought the printer I installed the software (on Windows 7 OS) from the disc and e

  • Connecting laptop to monitor/TV and image is not full screen

    I tried to connect my hp stream 11-d010ca to my monitor and my laptop via HDMI but could not get the image to appear "full screen". The picture is being duplicated fine but is only being shown in the centre of the screen and the image is not being st

  • Upgrading to 5.0

    Okay, so I've set up a 5.0 server. I configured it as a Multi-Master with a Changelog. I saved those settings. I then clicked on Replication on the navigation tree, then in the right-hand side of the window, clicked on the Legacy Consumer Settings ta

  • Report for getting bp without activites

    Hello experts, I just want to select all bp of our system, which do NOT have activites:   TABLES: but000,           but020,           adrc,           smovbka. " activites   DATA: zbut000 TYPE TABLE OF but000.   SELECT *   FROM ( but020          INNER