3

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?

6
  • 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. Commented Oct 19, 2020 at 17:40
  • I have the exact same issue, did you figure it out? Commented Mar 23, 2021 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/…
    – Shanerk
    Commented Apr 30, 2021 at 11:56
  • Never figured it out, would love to know Commented Dec 20, 2021 at 13:29
  • I have run into the same. Am logged in as system administrator, but you need to ensure to CHECK 'use tooling api'. Then it will work.
    – Alexx
    Commented Mar 9, 2022 at 23:15

0

You must log in to answer this question.

Browse other questions tagged .