Set Workflow using Item Buckets Search Operations

Recently one of our clients asked to set the workflow on large number of items that were created without workflow, so i was thinking of writing a script on powershell to do that, but then i thought why not extend Item buckets Search operation and add "Set Workflow" option there!

Basically, You will need to write a command that sets the workflow for all items in search results, and register that command.

1- The Code:

2- The Configurations:
<configuration xmlns:patch="">
      <command name="bucket:setworkflow" type="Sitecore.SharedSource.Buckets.SearchOperations.SetWorkflow, Sitecore.SharedSource.Buckets.SearchOperations"/>

3- Adding Command item in Sitecore:

  •  Open Content Editor and go to "/sitecore/system/Settings/Buckets/Settings/Search Operations/Fields"
  • Create new item of Template "/sitecore/templates/System/Item Buckets/Dropdown List", name it "Set Workflow".
  • In "Type" field, enter "bucket:setworkflow" and in "List Name" field, enter "Set Workflow", and choose a proper icon for that item :) .

The Result!


Popular posts from this blog

Caching Rendering HTML when conditional rules are applied

Building Sitecore Content Search Queryable using Rules engine

Update item name using Sitecore Item Web API