2

While these queries work:

select Name from StandardAction where EntityDefinition.QualifiedApiName = 'Account'
select Name from StandardAction where EntityDefinition.QualifiedApiName = 'Asset'

these queries don't work:

select Name from StandardAction where EntityDefinition.QualifiedApiName in ('Account', 'Asset')
select Name from StandardAction where EntityDefinition.QualifiedApiName = 'Account' or EntityDefinition.QualifiedApiName = 'Asset'

Error:

UNKNOWN_EXCEPTION

[object Object]: An unexpected error occurred. Please include this ErrorId if you contact support: 452578031-206493 (1257218050)

Any ideas on how to efficiently workaround this bug?

1 Answer 1

0

I haven't run queries on this object so far.. but looking at the EntityDefinition object definition SOQL Limits section, it seems only equals operator is supported on this object

Example Query:

SELECT qualifiedapiname FROM EntityDefinition WHERE qualifiedapiname!='Account' 

Error Returned: Only equals comparisons permitted

as mentioned by San in the comment, the In operator is working on the EntityDefinition when we query the object directly.

SELECT qualifiedapiname FROM EntityDefinition WHERE qualifiedapiname in ('Account','Case')

but it's not working when you do the cross object query between StandardAction and EntityDefinition.

so as a workaround what you can do is get all the Id

/services/data/v34.0/tooling/query?q=select+Id+from+EntityDefinition+where+QualifiedApiName+in+('Account','case')

and then use the In clause on EntityDefinitionId by passing in the ids.

/services/data/v34.0/tooling/query?q=select+Name+from+StandardAction+where+EntityDefinitionId+in+('4ie9xxxxx','4ie9xxxx')

I just tried this in Workbench REST Explorer and its working fine.

3
  • We can use IN operator to compare more than one value.
    – San
    Aug 12, 2015 at 10:38
  • This seems viable. Thanks! However, if the equals operator is the only supported comparison on QualifiedApiName why does my 4th query not work? I am pairing equals with OR.. This API is weird.
    – Mossi
    Aug 12, 2015 at 18:44
  • the same limits section has the details for OR as well. Aug 12, 2015 at 20:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .