[SalesForce] Query For Custom Metadata Type WHERE Field = false Returning 0 Rows But Matching Record Exists

I'm querying my Custom Metadata Type VRecTypeNm__mdt using

SELECT Label,ProductName__c,ProductCategory__c,EuOpps__c,NaOpps__c,PhysicalCard__c
  FROM VRecTypeNm__mdt
 WHERE Label = 'CP Virtual All In One' AND PhysicalCard__c = false

this query returns no rows. Despite there being a matching record –

Metadata Record

But when I remove AND PhysicalCard__c = false from the query, this is the result

Query Result

which shows that the field's value is false so why isn't the record being retrieved when I include the PhysicalCard criteria?

Best Answer

What is interesting to me is that in the first screenshot, NA Opportunities renders as an unchecked box, while Physical Card renders as blank. Is there any difference if you change the query to check "= null" instead?

@Jeff yes it looks like that's the answer. Once I check & uncheck the checkbox, the record is retrieved successfully. I had created the metadata records, then created the boolean field & was querying that field before I had set it's value.

Alex S

UPDATE

Now a Known Issue.

UPDATE

Known Issue now resolved.

Related Topic