Fire Workflow by system account?

I am back after 2 months ….Today we release project in SharePoint 2010 .

In this project we had one module that convert document from one format to another .Each document need to be approve by Approval administrator .

images (1)

SharePoint converting document using system account ,we stuck here for how to fire WORKFLOW by system account?

 

I had spent more time to find this solution and we find solution that in event receiver fire WORKFLOW through code.

 

Here is the code ….

 

SPWorkflowAssociation wfAssoc = spfileNewFile.Item.ParentList.WorkflowAssociations.GetAssociationByName(workflowName, System.Globalization.CultureInfo.CurrentCulture);

spfileNewFile.Item.Web.Site.WorkflowManager.StartWorkflow(spfileNewFile.Item, wfAssoc, wfAssoc.AssociationData, true);

spfileNewFile.Update();

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s