Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6896735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:04:52+00:00 2026-05-27T07:04:52+00:00

SharePoint 2007 Sequential Workflow in VS 2008 There is an issue wherein my workflow

  • 0

SharePoint 2007 Sequential Workflow in VS 2008

There is an issue wherein my workflow will complete if only one account is specified, but will fail and create only the first task if multiple users are specified.

In my list, I have a required Person or Group column called RequiredReviewers, in which multiple users are allowed to be selected upon creation.

I’ve created a sequential workflow with the following three Activities:
1) OnWorkflowActivated: onWorkflowActivated1, workflowToken, onWorkflowActivated1_Invoked
2) WhileActivity: whileCreateTasks, (no token associated here), Code Condition: WhileTaskIsNotCompleteCondition
3) within the while, there is one CreateTask activity: createTask1, taskToken, createTask1_MethodInvoking

public sealed partial class Workflow1 : SequentialWorkflowActivity
{
    public Workflow1()
    {
        InitializeComponent();
    }

    public Guid workflowId = default(System.Guid);
    public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
    public int _numRequiredReviewers = 0;
    public SPFieldUserValueCollection RequiredReviewers = null;

    public Dictionary<Guid, bool> TaskCompleted = new Dictionary<Guid, bool>();
    public const string ApproverGroupName = "Approvers - ATC";
    public SPUserCollection ApproverGroupUsers = null;

    private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
    {
        _numRequiredReviewers = 0;
        RequiredReviewers = (SPFieldUserValueCollection)((SPItem)workflowProperties.Item)["RequiredReviewers"];
        ApproverGroupUsers = workflowProperties.Web.SiteGroups[ApproverGroupName].Users;
    }

    private void createTask1_MethodInvoking(object sender, EventArgs e)
    {
        CreateTask task = sender as CreateTask;

        task.TaskId = Guid.NewGuid();
        task.TaskProperties = new SPWorkflowTaskProperties();

        task.TaskProperties.TaskType = 0;
        task.TaskProperties.Title = string.Format("{0} - {1} - {2}", workflowProperties.List.Title, workflowProperties.Item.File.Name, RequiredReviewers[_numRequiredReviewers].User.Name);
        task.TaskProperties.AssignedTo = workflowProperties.Originator;

        task.TaskProperties.PercentComplete = 0F;

        task.TaskProperties.SendEmailNotification = false; //default email communication;

        task.TaskProperties.ExtendedProperties["User"] = workflowProperties.OriginatorUser.LoginName;


        _numRequiredReviewers++;
        TaskCompleted.Add(task.TaskId, false);

    }

    private void createTasksWhileCondition(object sender, ConditionalEventArgs e)
    {
        e.Result = RequiredReviewers.Count != _numRequiredReviewers;
    }
}

The code will execute appropriately for one user.

The code will navigate through, and hit the createTask1_methodInvoking function the correct number of times. However, only the task of the first user specified is created, and the workflow status will return “Error Occurred” with no explanation or entry within the logs. VS does not catch any errors. I’ve tried this within a replicator (versus while loop) and I get the same if not worse results.

Any help is appreciated. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:04:53+00:00Added an answer on May 27, 2026 at 7:04 am

    You should place sequenceActivity element into while block and put your “Create Task” element to it. Then set ownerActivityName property of “Create Task” element to name of sequenceActivity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a SharePoint 2007 Sequential Workflow and am trying to activate two workflows
I've created a quiz web part in SharePoint 2007, but am stuck on one
Im confident that this isnt a sharepoint 2007 issue, but id rather cover all
My Sharepoint 2007 web part executes code to start a K2 workflow process. The
In SharePoint 2007, there's a top nav that the user can hover over, which
I have development environment with 64-bit SharePoint 2007. I tried to create SharePoint workflow
We have a SharePoint 2007 deployment which will have a substantially large document library.
How to create a sharepoint 2007 site by impersonating with custom account, so that
I am using SharePoint 2007 Enterprise with Windows Server 2008. I am using VSTS
I'm developing a Sharepoint 2007 application with Visual Studio 2008 / C#. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.