You need to sign in to do that
Don't have an account?
ss kumar
create trigger cls on object to differentiate the two record types
my requirment is i've one object in this object i've two record types .when ever i create or update the record i want to display the specific record type name in decription field.
If you want that your record description fiels to contain Record Type name then you can try this trigger.
Trigger :- Handler Class :-
Here you can replace "Account" with your object name and "Description" with your own custom field name.
I hope it will help you!
Thanks.
For your requirement, you can create a trigger on the object and update the description field with the name of the specific record type whenever a record is created or updated. Here's an example of how you can implement it: This trigger will fire before the records are inserted or updated. It retrieves the record type information using the getRecordTypeInfosById() method on the object's Describe result. It then updates the Description__c field with the name of the record type for each record in the trigger context.
If this helps , please mark this as Best Answer.
Thank you..