Applying a Workflow to All Existing Pages in a Portal

Overview

Currently, to change a page workflow, you would have to go through each page and change them one by one. This article provides a script that will apply a workflow across all currently existing pages in a Portal.

 

Prerequisites

 

Solution

NOTE: Make sure to take a backup of the database before attempting.

Essentially, the script will loop through all of the tabs in a particular portal using a cursor and will update the state ID to the published state name (that you will define in the script). This script will then set all the pending drafts to published. This script will publish all drafts within the specified Portal.

  1. You will need to update the following information for the script:
    • PortalID
    • WorkflowName
    • WorkflowPublishedStateName
  2. Execute the script in Settings > SQL Console or SQL Server Management Studio

 

 

Testing

You can test that this workflow has been applied to all pages in the portal by:

  1. Go to Settings > Workflows
  2. Edit Workflow > Click View Usage

2020-06-01_1624.png

Attachments

Comments

0 comments

Please sign in to leave a comment.