Question

I have a state machine workflow and related task. Task can be edited until it satisfy some conditions. Task formed by infopath. These task contains one people picker field. I assign 3 fields with these values:

private void createTask_Operator_MethodInvoking(object sender, EventArgs e)
{
 this.createTask_Id = Guid.NewGuid(); 

 this.createTask_Properties.ExtendedProperties["ows_TaskDisplayName"] = "user1";
 this.createTask_Properties.ExtendedProperties["ows_TaskAccountId"] = @"SP\user1";
 this.createTask_Properties.ExtendedProperties["ows_TaskAccountType"] = "User"; 
}

It is works, I can see in my form value these user. But when I change the user(for example: "user2") and submit the form, I cannot retrieve my manually changed field value, it always returns values of "user1".

private void onTaskChanged_Operator_Invoked(object sender, ExternalDataEventArgs e)
{
  this.onTaskChanged_AfterProperties = this.onTaskChanged.AfterProperties;
  this.onTaskChanged_BeforeProperties = this.onTaskChanged.BeforeProperties;

  // here I cannot retrieve changed field value, always returns: SP\user1
  this.workflowProperties.Item["UserName"] = 
      this.onTaskChanged_AfterProperties.ExtendedProperties["TaskAccountId"].ToString();
  this.workflowProperties.Item.Update();
}

Please, if you faced such problem, help me with that...

No correct solution

OTHER TIPS

I'm having a little trouble understanding your problem, but here are two answers. To successfully set the value of a people picker field, you have to correctly populate all three fields: DisplayName, AccountId, and AccountType. AccountType is always "User", but the other two have to align with your AD or wherever you're getting your user data from. To get data from a people picker, the best solution often includes the double eval trick: eval(eval(person, "concat(my:AccountId, ';')"), "..") This handles multiple entries correctly, if you mean that you're only getting the first in the list.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top