Hi Swathi, your requirment is good but you can fill fullName using formula instead of trigger. but if you want to write a trigger for it then you should try following trigger.
trigger contactTriggerForFullName on Contact (before insert, before update) {
if(trigger.isBefore){
if(trigger.isInsert || trigger.isUpdate ){
for(contact con : trigger.new){
con.FullName__c = con.FirstName + ' ' + con.LastName;
}
}
}
}
let me know if it's helps you and close your query marking it as solved. so that it can help to others.
You need to create custem field on Contact i.e FullName.
I hope it will help you.If it will help you please mark best answer.
Thanks
All Answers
You need to create custem field on Contact i.e FullName.
I hope it will help you.If it will help you please mark best answer.
Thanks
When you can accomplish this using click tools that salesforce offers out of the box, is there a reason to go with trigger?
You can create a simple formula field like below on your object (say Opportunity)
Opportunity__r.Owner.FirstName + " " + Opportunity__r.Owner.LastName
Related: https://trailblazers.salesforce.com/answers?id=90630000000h7yJAAQ
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Hi Swathi,
let me know if it's helps you and close your query marking it as solved. so that it can help to others.your requirment is good but you can fill fullName using formula instead of trigger. but if you want to write a trigger for it then you should try following trigger.
hi Swathi,
if it helped you then please marking it as best so that it can help to others.
Thank You