
I'm trying to get some aggregates from Opportunity objects by running a SOQL query against the rest API.
SELECT sum(One-off) FROM Opportunity
Issue is the field name contains a "-", which makes the API return a SalesforceMalformedRequest error
ERROR at Row:1:Column:14\nunexpected token: '-'", 'errorCode': 'MALFORMED_QUERY
I tried to escape the '-' character but it didn't work : (
3 Antworten
Javier, One-off is the label of the field. You need to use the API name instead like this:
SELECT SUM(One_off__c) FROM Opportunity