I have created a simple workflow that creates a list item and sends to list item id to an email address. This works without any problems.
I would like to change the workflow so that I can:
1. Call the process from an aspx page,
2 Populate the list item information form the apsx page
3. Save the list it
4. Have the process return the list item id
I have steps 1-3 working, however, I cannot get the list item id back from the process
Here's the code I'm using:
string ListId ;
Connection conn = new Connection();
conn.Open("xxxxxx");
string name = @"ManageListItem1Request List Item";
ProcessInstance pi = conn.CreateProcessInstance(name);
pi.DataFields["Title"].Value = this.txtTitle.Text;
pi.DataFields["Message"].Value = this.txtMessage.Text;
ListId = pi.DataFields["ListItemID"].Value.ToString();
pi.Folio = this.txtTitle.Text;
conn.StartProcessInstance(pi);
blInfo.Text = "Your item id is " + ListId;
conn.Close();