1

How to identify a custom object from the EntityDefinition object response? I know that we can check for the QualifiedApiName field if it ends with "__c" and publisherid != 'System' then it is a custom object. But I am seeing more records with this format than what is displaying in the UI under Object manager as custom object. For example I am not seeing the below entities in the UI, but they are appearing in the API response: APXTConga4__Conga_Composer_Settings__c APXTConga4__Conga_Solutions_Settings__c

I can see for them the IsCustomSetting is true. Does it mean they are not custom object?

Can someone please explain this, thanks.

4 Answers 4

2

Custom Settings are kinda, sorta custom objects. You retrieve and deploy them using the CustomObject metadata type. They just have a different interface for us to use (and some extra application cache magic).

If you're only looking for custom SObjects though, then you could filter on the KeyPrefix, as the key prefix for custom objects is always aXX where "X" can be 0-9, a-z, A-Z

WHERE KeyPrefix LIKE 'a%' should be what you're looking for

+edit:
Ok, so custom settings also have an aXX prefix. The IsCustomSetting field looks to be a vital part of distinguishing custom object from custom setting.

0

These are Custom Settings, a special type of custom object. The records are exposed in the application cache for rapid access by Apex code or declarative automations. Their definitions and records are found in the Setup menu under "Custom Settings."

More information is available in the Apex Developer Guide and Salesforce Help.

0

It is not necessary that EntityDefinition object would have only details about the objects visible in Object manager UI. It will have standard objects used by Salesforce for internal purpose, custom objects from app exchange installed packages, custom settings etc. Refer to Tool API developer guide here to understand everything about the EntityDefinition object fields and use them for querying.

For example I am not seeing the below entities in the UI, but they are appearing in the API response: APXTConga4__Conga_Composer_Settings__c APXTConga4__Conga_Solutions_Settings__c

These are from managed package Conga Composer and hence, not visible in Object manager UI.

I can see for them the IsCustomSetting is true. Does it mean they are not custom object?

Yes, they are not custom object, but they are custom settings.

2
  • They are visible in the UI, just not in Object Manager; they're under Custom Settings in the main Setup menu. Commented Jul 7, 2022 at 14:55
  • @ThomasTaylor Thanks for pointing that out. It was a typo. I meant to say Object manager. Will amend my answer. Also, I was typing that out about custom objects from managed packagees
    – arut
    Commented Jul 7, 2022 at 14:57
0

To filter the results down to only the things you would see in the object manager, you can use the IsCustomizable field of the EntityDefinition.

Add that to the other fields mention here (PublisherId and IsCustomSetting) to find the custom objects that would appear in the object manager.

SELECT DurableId, QualifiedApiName FROM EntityDefinition WHERE PublisherId != 'System AND IsCustomizable = true AND IsCustomSetting = false

You must log in to answer this question.

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