You need to sign in to do that
Don't have an account?
Beto Carvalho 11
Query WorkflowRule filtering by metadata (e.g. active, triggerType)
I'd like to find all Workflow Rules which run on Object X, are active, and e.g. trigger on create only. Using Tooling API I can get this far, of course:
Object = WorkflowRule
TableEnumOrId = 'Opportunity'
Metadata > triggerType = onCreateOnly
Metadata > active = true
Any way to run this query on Developer Console, Workbench REST Explorer or something of the sort?
Select ID, Name From WorkflowRule Where TableEnumOrId = 'Opportunity'I'd like something like this (dream query):
Select ID, Name From WorkflowRule Where TableEnumOrId = 'Opportunity' AND metadata.triggerType = 'onCreateOnly' AND metadata.active = trueOf course I made up the above syntax (after TableEnumOrId = 'Opportunity').
Object = WorkflowRule
TableEnumOrId = 'Opportunity'
Metadata > triggerType = onCreateOnly
Metadata > active = true
Any way to run this query on Developer Console, Workbench REST Explorer or something of the sort?
You can try below snippet.
>> Open workbench.
>> Navigate to Rest Explorer.
For all workflow rules (Including inactive )
/services/data/v47.0/tooling/query?q=Select+Id,Name,TableEnumOrId+From+WorkflowRule
For all workflow rules by object.
/services/data/v47.0/tooling/query?q=Select+Name,TableEnumOrId+From+WorkflowRule+where+TableEnumOrId='Account'
Also you cannot use 'metadata.triggerType = 'onCreateOnly' AND metadata.active = true' in SOQL query.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks,
Vinay Kumar