function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mukesh_SfdcDevMukesh_SfdcDev 

Tooling Api query on metadata field of workflowRule and ValidationRule

Hi Experts,

I want to get the metadata result of workflow rule and Validation Rule through tooling api.
but salesforce have a limit "Query this field only if the query result contains 
no more than one record. Otherwise, an error is returned. If more than one record exists, 
use multiple queries to retrieve the records. This limit protects performance."

this query working fine:
/services/data/v41.0/tooling/query/?q=Select+Name,MetaData,TableEnumOrId+From+WorkflowRule+LIMIT+1

but I want more than record like the below query and this not work : 
/services/data/v41.0/tooling/query/?q=Select+Name,MetaData,TableEnumOrId+From+WorkflowRule
is there another alternate solution to overcome of such type of situation.

Thanks 
Mukesh Kumar
Amit Chaudhary 8Amit Chaudhary 8
Cannot retrieve more than one record with Metadata or FullName fields in the query
This is the know issue https://success.salesforce.com/issues_view?id=a1p300000008YgSAAU

Please check below post for workaround
1) https://success.salesforce.com/issues_view?id=a1p300000008YgSAAU


NOTE:- If you will remove metadata then your query will work
/services/data/v41.0/tooling/query/?q=Select+Name,TableEnumOrId+From+WorkflowRule

I hope this will help you