Create Sequential Site Workflow in SharePoint

Using this create list in site level when the work flow activated in site level.
 
Step 1: Open VS with new empty SharePoint project in farm solution.

Step 2: Add a new item Sequential Workflow for site workflow.
 
Step 3: Choose Site workflow Option.

Step 4: Click Next And Finish.(Using site work flow we start manually by default).

Step 5: ClickOnworkflowActivity.

Step 6: Write Following Code.
  1. private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)  
  2. {  
  3.    SPWeb topsite = workflowProperties.Web;  
  4.    topsite.Lists.Add("Hello"" ", SPListTemplateType.Contacts);  
  5.    SPList listcon = topsite.Lists["Hello"];  
  6.    listcon.OnQuickLaunch = true;  
  7.    listcon.Update();  
  8.    topsite.Update();  
  9. }  
After the deploy the project.Then go to site contents in our share point site.click site workflows and start that workflow and the output become create our list in that site.  
Ebook Download
View all
Learn
View all