0

I get this error when querying for DeveloperName via the Tooling API even though I can perform the same query in the developer console with the same user.

"No such column 'developername' on entity 'RecordType'"

  1. system.debug([select developername from recordtype]);//Error
  2. The same query worked well using Workbench.
  3. system.debug(Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('SomeRecordTypeName').getRecordTypeId());//Works Well

I found no documentation either answer why this error is thrown.

2
  • Are you getting the error from the Tooling API or just from a debug using Execute Anonymous? Your post is a bit unclear on this point.
    – Adrian Larson
    Commented May 6, 2021 at 16:07
  • I'm getting it from the Tooling Api. Using Execute Anonymous i get no error
    – DavidS
    Commented May 6, 2021 at 16:11

2 Answers 2

1

If you look at the documentation for RecordType specific to the Tooling API, you can see what fields are defined for access there. Specifically, it doesn't have DeveloperName, but rather Name.

1

Querying Record Type data is not the same as querying Record Types through the Tooling API. Specifically, different fields are available in each instance. For the Tooling API, there is a Name attributes, which corresponds to the label, and the FullName attribute, which is the SObject type plus the API Name (ie 'Opportunity.Record_Type_Name'). It's important to note that you can only use FullName in a Tooling API query if a single record is returned. Here's a link to the documentation for Record Types.

You must log in to answer this question.

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