how can i create trigger on contact object where if change mailing address field or enter new mailing address in new contact then it automatically add on street adress field please help
trigger updateAddress on Contact (before Insert,before update) {
for(contact cc : trigger.new){
// check if contact MailingStreet is not equal to null then update other field address
if(cc.MailingStreet != null){
cc.OtherStreet = cc.MailingStreet;
// set other fields here in same way
}
}
}
1.sure bro i am asking that i want to create trigger on contact object 2.when i am insert or edit contact then if fill street adress 3. then it automatically same address should be in ( Other Address )field
trigger updateAddress on Contact (before Insert,before update) {
for(contact cc : trigger.new){
// check if contact MailingStreet is not equal to null then update other field address
if(cc.MailingStreet != null){
cc.OtherStreet = cc.MailingStreet;
// set other fields here in same way
}
}
}
All Answers
Thanks
2.when i am insert or edit contact then if fill street adress
3. then it automatically same address should be in ( Other Address )field