3 réponses
Hi Sandy,You can use the below logic to get the record type name.
If this solution helps, Please mark it as best answerThanks,trigger AccountTrigerr on Account (before update) {
Map<ID, Schema.RecordTypeInfo> rtMap = Schema.SObjectType.Account.getRecordTypeInfosById();
for(Account acc:Trigger.new){
if(rtMap.get(acc.RecordTypeId).getName() =='merchant KYC Account'){
acc.Rating='Hot';
}
}
}