6

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?

  • Are there any extra spaces in the 'CP Virtual All In One' value in the row that are being hidden by the HTML presentation? – Keith C Mar 23 '16 at 14:24
  • @KeithC no there aren't. – Alex S Mar 23 '16 at 14:26
  • 1
    Just saw your "when I remove" point in the question a bit too late. – Keith C Mar 23 '16 at 14:28
  • 4
    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? (There shouldn't be, but it wouldn't be first problem with metadata checkboxes: success.salesforce.com/issues_view?id=a1p300000008bS6AAI) – Jeff Mar 23 '16 at 14:40
  • 1
    @Jeff yes it looks like that's the answer. Once I check & uncheck the checkbox, the record is retrieved successfully. When I created the record using the Custom Metadata Loader, I didn't explicitly set the checkbox to false.. – Alex S Mar 23 '16 at 14:42
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.