1

I'm trying to use the Salesforce REST API in order to get an OrderSummary sObject using its ID.

With the following query /composite/sobjects/:SOBJECT_API_NAME?ids=1Os1q0000004FpWCAU&fields=BillingAddress everything run smooth and this is the result:

    {
        "attributes": {
            "type": "OrderSummary",
            "url": "/services/data/v54.0/sobjects/OrderSummary/1Os1q0000004FpWCAU"
        },
        "BillingAddress": {
            "city": "Torino",
            "country": "IT",
            "geocodeAccuracy": null,
            "latitude": null,
            "longitude": null,
            "postalCode": "10098",
            "state": "TO",
            "street": "Via Roma 99"
        },
        "Id": "1Os1q0000004FpWCAU"
    }
]

However, in case I need all the OrderSummary fields this is the written query /composite/sobjects/:SOBJECT_API_NAME?ids=1Os1q0000004FpWCAU&fields=fields(all) which returns the following error:

[
    {
        "message": "The SOQL FIELDS function must have a LIMIT of at most 200",
        "errorCode": "MALFORMED_QUERY"
    }
]

Is it possible to add the limit param inside the retrieve flow in order to get rid of the error?

1 Answer 1

4

Doesn't look like you can add a limit here.

The relevant documentation states that the only parameters are ids and fields.

If you want to use FIELDS(ALL), then it looks like you need to use the query resource. e.g. /services/data/v55.0/query/?q=SELECT+FIELDS(ALL)+FROM+OderSummary+WHERE+Id+%3D+%271Os1q0000004FpWCAU%27

%3D = =
%27 = '

No +LIMIT+200 required with the query resource since Salesforce knows that the query won't return more than 200 records (though it's unclear why the /composite/sobjects resource can't internally do the same).

1
  • That feels like a bug, if you ask me.
    – sfdcfox
    Commented Oct 12, 2022 at 15:19

You must log in to answer this question.

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