1

You can view custom object field limits by going on:

App > Customize > Object > Limits

Is there a way of getting a list of all objects with the current number of used custom fields?

EDIT: I know there are app exchange tools but I cannot use them - I need a soql quer/ report or a SF native tool (no installations or third parties)

  • 2
    You can do it rather clumsily with the Tooling API in the Developer Console: SELECT count(DeveloperName), TableEnumOrId FROM CustomField GROUP BY TableEnumOrId. But it supplies a mix of standard object names and custom object Ids; I hope there's a better solution. – David Reed Jun 19 '18 at 15:53
  • @DavidReed This actually would have been my first thought. As clumsy as it is, I don't think we have a better tool for this. – sfdcfox Jun 19 '18 at 15:56
2

I'll convert this comment into an answer.

You can obtain this data rather clumsily with the Tooling API in the Developer Console. Enter the following in the Query Editor, and check the "Use Tooling API" box:

SELECT count(DeveloperName), TableEnumOrId FROM CustomField GROUP BY TableEnumOrId ORDER BY count(DeveloperName) DESC 

That'll get you the objects with the highest count of custom fields at the top. Note that it supplies a mix of standard object names and custom object Ids, each one with the count of custom field attached to it. To find the name of a given Custom Object's Id, you can issue another query:

SELECT DeveloperName FROM CustomObject WHERE Id = 'THE_ID'

Or, of course, you can build yourself a translation table with

SELECT Id, DeveloperName FROM CustomObject
  • Hi David - do I need to add the record type name in the 'developer name' - does the query count how many custom fields are being used by each record type? that's the way I understand it but might be wrong -- can you provide an example? thanks – TheAdmin Jun 19 '18 at 19:33
  • @TheAdmin, all fields on an object are available on all record types, barring validation code or rules. Are you thinking of picklist values, which may be filtered by the current record type? – David Reed Jun 19 '18 at 19:36
  • Sorry, I didnt check the tooling API checkbox - all working now and marked it as accepted answer! Thanks again! – TheAdmin Jun 19 '18 at 20:17

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.