0

In my apex code, I have this SOQL: [SELECT ID FROM Publisher Order By Id], this SOQL works fine in API 49, after upgrade to API 54, Salesforce will throw error run this SOQL.

After research I found this changes in API 51, after that Publisher Id can not "order by". But I don't find any Salesforce Document mention this change, may I ask about Salesforce Document link about changes?

Additional Information

Please take look this image, Publisher Id sortable is true, so how can I know whether this ID field can sort or not?

enter image description here

Best wishes, Lee

2
  • 3
    This is likely a bug. I have filed an investigation with the concerned Salesforce product development team to confirm the same and will let you know as I have more details. Thank you Commented Jun 13, 2022 at 14:22
  • 1
    @Swetha, We have a product that using ORDER BY clause in many places, and API version is 54. As planned, we will release our new version in 2 months. Could you please investigate this issue and fix it ASAP?
    – GhostLee
    Commented Jun 14, 2022 at 5:50

1 Answer 1

1

Based on the update from the Salesforce R&D team, the "Publisher" entity doesn't support ORDER BY ID. The error being shown is part of corrected behavior.

The query SELECT ID FROM Publisher Order By Id doesn't throw the error in past versions, but this is virtual, order by Id has no effect. The error now bubbles-up because sort doesn't work. Please consider not to use ORDER BY ID against Publisher entity.

Salesforce investigation reference #W-11286414

4
  • 1
    Besides "Publisher" object, the same error throws when we use OrderBy clause in other objects, like "PicklistValueInfo", "ColorDefinition" and "IconDefinition". Is there any official online documentation that lists all objects not supported OrderBy clause? As you see, some objects supports, but some ones do not. We have to test all objects. It's significant work for us, especially our release date is coming soon.
    – GhostLee
    Commented Jun 20, 2022 at 1:57
  • I updated new Image for Id Schema of Publisher object. As you said, Id could be not used in Orderby clause, but its sortable is true. If so, how to check whether Id field could be used in Orderby clause or not? Why its sortable of Schema is still true if Id could not be sortable as you said?
    – GhostLee
    Commented Jun 21, 2022 at 1:27
  • I am checking this…. Commented Jun 21, 2022 at 3:58
  • I am continuing to coordinate for inputs on your latest ask. We noticed that other entities such as TabDefinition, EmbeddedServiceDetail are also not sortable by Id but it's sortable is true in Describe information. We need to look at it from the framework side. Commented Jun 24, 2022 at 9:11

You must log in to answer this question.

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