User-Defined Workflows Disabled by the SharePoint Administrator

User-defined workflows have been disabled by the SharePoint Administrator. User-defined workflows will be unable to run.

Description

In this article you will see how to resolve the error "User-Defined workflows have been disabled by the SharePoint Administrator. User Defined workflows will be unable to run."

Error

When I was trying to create a simple workflow using the SharePoint Designer, I was getting the following error:

Share1.jpg

Reason

This is because SharePoint Administrators have disabled the SharePoint Designer workflows so that users will not be able to create custom SharePoint Designer workflows.

How to resolve:

Through Central Administration

  1. Go to Central Administration.
  2. Click on Application Management, and then click on Manage Web Applications.
  3. Select the Web Application for which the SharePoint Designer workflows must be enabled.
  4. In the ribbon interface, click on the General Settings drop down.
  5. Click on Workflow.

    Share2.jpg
     
  6. Select yes under the "Enable user-defined workflows for all sites on this web application?" option.

    Share3.jpg

Programmatically Enable SharePoint Designer workflows

namespace Console
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Administration;

    class Program
    {
        static void Main(string[] args)
        {
            SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://serverName/"));

            //// Disabling the SharePoint Designer workflows for the web application
            webApp.UserDefinedWorkflowsEnabled = false;
            //// Update the Changes
            webApp.Update();
        }
    }
}

Reference: http://www.c-sharpcorner.com/uploadfile/anavijai/sharepoint-workflow-settings-for-sharepoint-2010-web-application/

Summary

Thus in this article you have seen how to resolve the error "User-Defined workflows have been disabled by the SharePoint Administrator. User Defined workflows will be unable to run." Or how to enable or disable the SharePoint Designer workflows.