Ads

Thursday, 26 December 2013

Create an Event Receiver to start Nintex Workflow

public override void ItemUpdating(SPItemEventProperties properties)
 {
SPWorkflowManager WfManager = properties.ListItem.ParentList.ParentWeb.Site.WorkflowManager;
SPWorkflowAssociationCollection wfAssociationCollection = properties.ListItem.ParentList.WorkflowAssociations;
SPWorkflowAssociation wfAssociation = wfAssociationCollection.GetAssociationByName("HistoricalDataAudit", System.Threading.Thread.CurrentThread.CurrentCulture);
 

foreach (SPWorkflowAssociation wfAssociationCollectionItem in wfAssociationCollection)
{
  WfManager.StartWorkflow(properties.ListItem, wfAssociationCollectionItem,"");

}

No comments:

Post a Comment

Ads