Getting Workflow Rules

--

Let's say that you need to know how many Workflow Rules are there in your Org.

You can start counting one by one or you can run a query using Tooling Api to get that information.

In my case, there were 263 Workflow Rules, so counting them was not a possibility (unless you have lots of free time haha).

The query for this is super simple, let me show you:

SELECT count(Id), TableEnumOrId FROM WorkflowRule Group by TableEnumOrId

Remember to check “Use Tooling API” in Developer Console when doing it.

You will get a result of the number of Workflow Rules grouped by sObject.

If you only want to get the Workflow Rules for a specific sObject, you can do something like:

SELECT count(Id), TableEnumOrId FROM WorkflowRule WHERE TableEnumOrId=’YOUR_OBJECT_API_NAME’ Group by TableEnumOrId

--

--

Federico Kleinman
Federico Kleinman

Written by Federico Kleinman

Hey there! Salesforce Developer and soccer lover.

No responses yet