Issue which i facing is follows.
I have attached sp2010 approval workflow to list on item created.
When i insert entry into list manually, and it display workflow status is In Progress, it means workflow runs perfectly.
now issue with insert entry programatically.
When i insert entry through code. there is not displaying workflow status in that list item. it means workflow not attached. and not working
My Code for inserting items is
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite spsite = new SPSite(siteurl))
{
using (SPWeb spweb = spsite.OpenWeb())
{
SPList splist = spweb.Lists["My List"];
SPListItem oItem= splist.AddItem();;
oItem["Title"] = txtTitle.Text;
oItem["Author"] = objSPUser;
oItem["Editor"] = objSPUser;
oItem.Update();
}
}
});
I need to use SPSecurity.RunWithElevatedPrivileges function because user has not rights for that list.
User can Insert records through dashboard. so i updating Created By and Modified by using System account.
How to resolve ?
or any other alternate way to do this instead SPSecurity.RunWithElevatedPrivileges
