We are using the metadata API to access field metadata such as description, data type, default value etc. This is for standard objects but on custom fields e.g.:

SELECT Id, Metadata, TableEnumOrId
FROM CustomField 
WHERE DeveloperName = :fieldName
AND TableEnumOrId = :fieldType
AND NamespacePrefix = :namespacePrefix

For some customers this fails with sObject type 'CustomField' is not supported. We have checked the user permissions and they have a System Administrator profile with:

  1. API Access
  2. Modify All Data

What is actually needed to access this object?

  • Can you please try by running the SOQL query in the developer console and make sure that the Use tooling API checkbox is unchecked.Also,since it is System administrator profile the user should be able to query the Custom Field Sobject without any issues. Oct 19 '20 at 17:40
  • I have the exact same issue, did you figure it out? Mar 23 at 9:42
  • Did you ever figure this out. Odd that you have System Administrator profile and are running into this. I'm trying to figure out the specific permissions needed without having a System Admin profile. This post has some info but not the specifics: salesforce.stackexchange.com/questions/88937/…
    – Shane K
    Apr 30 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.