You need to sign in to do that
Don't have an account?
sreekanth reddy
Record Type Query
Hi All
How to get record type in Query.
I am trying below query.
it's Not Working.
String qry = 'select id, name, Country__c,RecordType.Name from Contact where name LIKE \'%'+searchText+'%\' and RecordType.Name =srikanth order by name';
Thanks
Srikanth.
How to get record type in Query.
I am trying below query.
it's Not Working.
String qry = 'select id, name, Country__c,RecordType.Name from Contact where name LIKE \'%'+searchText+'%\' and RecordType.Name =srikanth order by name';
Thanks
Srikanth.
You need to surrond the record type name with single quotes. However, since you're using dynamic soql, you'll also need to escape the quotes.
Furthermore, I would suggest using DeveloperName instead of Name for RecordType queries, as DeveloperName will not change (unless the RecordType is deleted and recreated), but Users or Administrators can change the Name itself of a record type for label or translations.
Try the following: