How to Create WF with C#

SharePoint Asked by What'sUP on January 8, 2021

I have learned about Workflow by dropping and clicking and the next phase is learn how to create WF with C# based this link

What material, link etc can you recommend me to learn about creating WF with C# coding? I have previous knowledge in, regular c# coding etc but not in relation to WF with C# code.

2 Answers

Here is the good example to start with SP workflow using Visual studio.

Please follow the below steps:

1-Start with a Sequential Workflow. Start Visual Studio and create a new project from the template SharePoint --> Sequential Workflow.

2-In the next screen select the option Site Workflow.

3-In the next screen, leave the default option saying the user manually starts the Workflow.

4-Create Activity

What is an Activity?

A Workflow consists of a series of Activities. We can add Activities using the Toolbox. There are different types of Activities like Code Activity, SendEmail, etc.

5-Drag and drop a Code Activity from the toolbox.

6-Add code for the Activity, add code for this Activity. Double click on the codeActivity1

    private void codeActivity1_ExecuteCode(object sender, EventArgs e)
    using (SPWeb web = SPContext.Current.Web)
    SPList list = web.Lists["Manager"];
    foreach (SPListItem item in list.Items)
        if (item["Address"] == null)
            item["Address"] = "PLEASE SET THE ADDRESS!";


7-Build and Deploy the Solution.

Answered by Rishi Jagati on January 8, 2021

Add your own answers!

Related Questions

How to Set up Search for Extended Web applications Sp2013

1  Asked on February 18, 2021 by allegro-octopus


Embed my website content in my sharepoint by URL

2  Asked on February 15, 2021 by hippyjim


Customized Form – Sharepoint Online library

1  Asked on February 14, 2021 by elised


Extract Excel file names into Sharepoint List

1  Asked on February 13, 2021 by madeline


Pinning a document to a SharePoint Home Page

1  Asked on February 11, 2021 by wrightyatwork


Recurring Work Flow

1  Asked on February 10, 2021 by curtis


Video views counter in SharePoint Online

1  Asked on February 3, 2021 by msiri28


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP