You need to sign in to do that
Don't have an account?
Prashant Gulve
write Apex Trigger on Lead object, there is 2 fileds Phone and Mobile Phone.if I make changes in phone same change needs to be happened in Mobile Phone filed as well.please help
Apex Trigger on Lead object, 2 Fileds Phone and Mobile Phone
if I make changes or updates/ modify any thing on phone same changes
needs to be happened to Mobile Phone as well?
Please Assist..
if I make changes or updates/ modify any thing on phone same changes
needs to be happened to Mobile Phone as well?
Please Assist..
Try Below Trigger Please Mark It As Best Answer If It Helps
Thank You!
All Answers
Try Below Trigger Please Mark It As Best Answer If It Helps
Thank You!
Try Below Trigger
trigger LeadTrigger on Lead (before insert,before Update) {
if(trigger.isbefore & trigger.isupdate){
// update Mobile Phone
for(lead led :trigger.new){
if(led.phone != null ){
led.MobilePhone = led.phone;
}
}
}
}
Please Mark It As Best Answer If It Helps
Thank You!
AMARESH
Thank you so much for your help both code working fine for me. Both are the best answer..
Thank you
Prashant Gulve
Thank you..
trigger syncphonetomobilephone on Lead (before update) {
if(trigger.isbefore && trigger.isupdate){
syncphonetomobilephonehandler.sync(trigger.new);
}
}
public class syncphonetomobilephonehandler {
public static void sync(list<lead> leadlist){
list<lead> leadstoupdate=new list<lead>();
for(lead l:leadlist)
{
l.MobilePhone=l.Phone;
leadstoupdate.add(l);
}
}
}
Hope this answer helps!
Venu