Use RecordType.DeveloperName instead of RecordTypeId

Use RecordType.DeveloperName! Each object has a reference to its RecordType. You can utilize that reference to query records by RecordType.

Use RecordType.DeveloperName instead of RecordTypeId

Avoid using recordTypeId to query records of a specific RecordType.

Don't do this
Id recordTypeId = [
    SELECT Id
    FROM RecordType
    WHERE DeveloperName = 'Partner'
].Id;

// OR

Id recordTypeId = Account.SObjectType
    .getDescribe(SObjectDescribeOptions.DEFERRED)
    .getRecordTypeInfosByDeveloperName()
    .get('Partner')
    .getRecordTypeId();

List<Account> accounts = [
    SELECT Id, Name
    FROM Account
    WHERE RecordTypeId = :recordTypeId
];

Use RecordType.DeveloperName! Each object has a reference to its RecordType. You can utilize that reference to query records by RecordType.

Use RecordType.DeveloperName instead of RecordTypeId — screenshot 2
Do this
List<Account> accounts = [
    SELECT Id, Name
    FROM Account
    WHERE RecordType.DeveloperName = 'Partner'
];

Text and code were extracted from the original slide. Plain-text version of the whole catalog