Forum Discussion

Gaurav Goyal's avatar
Gaurav Goyal
Brass Contributor
Dec 04, 2018

How to get custom reusable workflow feature in CSOM?

Hello,

 

I have created a custom reusable workflow in SharePoint Designer. I am facing an issue after deployment of workflow. I have to activate the workflow feature with CSOM but I am not able to get that feature with CSOM code. I have tried code but this code is not showing that custom workflow feature id. I have tried on web & site level also :

 

public static void GetAllWebFeatures(ClientContext ctx, Web web)
{

try
{
var webFeatures = web.Features;
ctx.Load(webFeatures, fcol => fcol.Include(f => f.DisplayName, f => f.DefinitionId));
ctx.ExecuteQuery();
foreach (var f in webFeatures)
{
Console.WriteLine(f.DisplayName);
}
}
catch(Exception ex)
{
Helper.WriteException("Error in GetAllFeatures", ex);
}


}

Resources