4

I'm performing this query against a Custom Metadata object:

SELECT Call_Center_Display_Script__c
FROM VDN_Mapping__mdt 
WHERE VDN__c = '99999' OR DNIS__c = '123456786' 
LIMIT 1

But I'm getting this error from Salesforce:

An error has occurred in the following section: [Exception, DisjunctionsNotSupportedException_desc]. Salesforce.com has been notified of this error.

Why does this occur and how can I resolve this?

2 Answers 2

9

Custom Metadata supports a limited SOQL syntax, and "OR" statements are not supported. From the documentation:

Custom metadata types support the following SOQL query syntax.

SELECT fieldList [...]
FROM objectType
    [USING SCOPE filterScope]
[WHERE conditionExpression]
[ORDER BY field {ASC|DESC} [NULLS {FIRST|LAST}] ]
  • The fieldList can include only non-relationship fields.
  • FROM can include only one object.
  • You can’t use COUNT with custom metadata types.
  • You can use the following operators.
    • IN and NOT IN
    • =, >, >=, <, <=, and !=
    • LIKE, including wild cards
    • AND
  • You can use ORDER BY, ASC, and DESC with multiple fields.

Notice that "OR" is not supported. Apparently that's called a "Disjunction"

0
0

There is currently a known issue that is preventing this from working correctly.

SOQL on metadata type records does not work properly when using LIKE in OR relationship

You must log in to answer this question.

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