Unable to retrieve results from a query when using count() on an external object in JSON Format
Last updated 2021-05-26 ·Reference W-3380364 ·Reported By 3 users
Current OData4J library to handle OData 2 providers has a bug in the JSON response parser.
When trying to query count() from an external object in developer console you will be seeing below error when External data source is in JSON format for some endpoints:
UNKNOWN ERROR: EXTERNAL_OBJECT_EXCEPTION: This data isn't available because the external data source "odata" doesn't support the COUNT() function
>> Go to Setup >> External Data sources
>> Click New
>> Give some name to External Data source.
>> Type: Salesforce Connect: OData 2.0
>> Url: https://orderdb.herokuapp.com/orders.svc/
>> Request Row Count should be checked.
>> Format: JSON
>> Authentication column can be anything.
>> Save it.
>> Then click on Validate and Sync and select all external objects.
>> Click on Sync.
Open Developer console
>> Go to Query Editor
>> Run count() query: For Eg: "select count() from Subcategorys__x" and you will see below error:
External_Object_Exception: [object Object]: This data isn't available because the external data source "odata" doesn't support the COUNT() function. Contact your administrator for help.
Go to External Data Sources and change the Format to AtomPub and re-run the query.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.