DYNAMICS 365 HOW TO EXECUTE WORKFLOW ON THOUSANDS/ALL RECORDS

Do you have a situation where you want to run a workflow for thousands or all records of an entity in Dynamics 365? If yes, then this post will help you to achieve it.

In CRM web client, you can run a on-demand workflows for only 250 records per entity, but, there is a workaround to overcome this limitation... using "Bulk Workflow Execution" plugin in XrmToolbox.

Based on a FetchXml query, you can now use the "Bulk Workflow Execution" plugin to retrieve records from CRM/D365 entities, select a specific on-demand workflow, and run the selected workflow on those records.

To accomplish this, you need to follow the below steps:
  1. Create a on-demand workflow to retrieve the records based on your needs
    For the sake of this demo, we will create a simple workflow on Account entity and add an Update step
    • Navigate to Settings > Processes > New
    • Fill the needed details in the pop-up window
    • In the design workflow, add an Update step for the account entity that will be applied on the records
    • Once done, click Save and then Activate your workflow
    Bulk execute workflow

  2. Get the FetchXML query from the Advanced Find to retrieve the needed or all records
    Click the Advanced Find button, design/build your query, and click on Download Fetch XML to get the FetchXML query
    Bulk execute workflow 2

  3. Configure the Bulk Workflow Execution plugin to run your workflow against your FetchXml query
    Bulk execute workflow 3

    • Open the XrmToolbox and search for Bulk Workflow Execution plugin
    • Select the on-demand workflow created in Step 1 above
    • Select the option Use Custom FetchXML Query
    • Paste the FetchXML query copied from the Advanced Find above
    • Click Validate Query to check the FetchXML query and correct it if any issues
    • Click Start Workflows to run your workflow and process all the result set based on the FetchXML query provided
    Bulk execute workflow 4


Hope This Helps!

Comments

Popular posts from this blog

DYNAMICS 365 FILTER LOOKUP FIELD BASED ON N:N RELATIONSHIP

DYNAMICS 365 LEVEL UP BROWSER EXTENSION - PART 1 - FORMS

DYNAMICS 365 REFERENCE PANEL