You need to sign in to do that
Don't have an account?
Displaying Record Type ID name in SOQL query
I am running a SOQL query. In it, I want to display the name of the Record Type rather than the ID number. If I create a query that includes:
Select .... RecordTypeID, I get the record type ID; however, when I use "RecordTypeID.name" or "RecordTypeID__r.name", I get this error:
ERROR at Row:1:Column:121
Didn't understand relationship 'RecordTypeID__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
I have the feeling that the Record Type name has different properties, but I am not using the correct syntax to display the name. What am I missing. Thanks.
Select .... RecordTypeID, I get the record type ID; however, when I use "RecordTypeID.name" or "RecordTypeID__r.name", I get this error:
ERROR at Row:1:Column:121
Didn't understand relationship 'RecordTypeID__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
I have the feeling that the Record Type name has different properties, but I am not using the correct syntax to display the name. What am I missing. Thanks.
Try using RecordType.Name in the SOQL query. As iti s a standard relationship you do not need __r.
All Answers
Try using RecordType.Name in the SOQL query. As iti s a standard relationship you do not need __r.