< Back to List
Ability to query RecordType.Name in SOQL instead of using a nested query to get
Campaigns & Leads
We would like to have the ability to query RecordType.Name in SOQL very much we do with the other objects, instead of using a nested query to get the Id first. Nested queries count against the total number of queries in a transaction and sometimes it is important to keep track of all nested queries.
Currently we get an UNKNOWN ERROR when querying the RecordType.Name in SOQL in a query that grabs CampaignMembers. Although this is not clearly mentioned in any documentation, Salesforce mentioned that using the RecordType.Name in SOQL is not supported and we should use a nested query to get the Id instead.
So, instead of:
SELECT ... FROM CampaignMember WHERE RecordType.Name = 'ABC'
SELECT ... FROM CampaignMembers WHERE RecordTypeId in (SELECT Id FROM RecordType WHERE Name = 'ABC')
We would like this to be fixed and supported and be able to query any object based on the RecordType.Name.
The Landmark © One Market St.,
San Francisco, CA 94105
If you can't find what you're looking for,
contact Salesforce Customer Support.
Powered by Community Cloud.
Learn More >
Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.
Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.
Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.
Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.