You need to sign in to do that
Don't have an account?
Chinna Sfdc
Updating trigger Help
Hi Team,
We have an requirement as mentioend below
1.When Phone # field is updated in Account , the same number has to get updated in Contact -> Phone # field and if the Phone # field in Contact is updated and the same Phone # has to be populated in Account -> Phone # field.
Through Trigger how we can acheive this,Can any one please Help me on this.
Thanks
We have an requirement as mentioend below
1.When Phone # field is updated in Account , the same number has to get updated in Contact -> Phone # field and if the Phone # field in Contact is updated and the same Phone # has to be populated in Account -> Phone # field.
Through Trigger how we can acheive this,Can any one please Help me on this.
Thanks
Thanks for your reply.
If I update account Phone # field then related contacts Phone field should update. this is what am expecting.I undrstand your question but since i don't have complete requirement, can you please update me one Account and one contact record.Based on your code i will modify accordingly.
Thanks
Getting Error like "Variable does not exist: lstContactToUpdate at line 7 column 12".Please help me on this.
Thanks
Am sorry ...We are trying to get below trigger.But still getting error like "Variable does not exist: Trigger at line 4 column 97"
trigger AccountTrigger on Account (after Update){
List<Contact> lstContactToUpdate = new List<Contact>();
for(Contact objContact : [SELECT Id,Phone, Account.Phone FROM Contact WHERE AccountId IN : Trigger.New()]){
lstContactToUpdate.add(new Contact(Id = objContact.Id,Phone = objContact.Account.Phone));
}
update lstContactToUpdate;
}
Thanks
Great..It is working fine But one more help hear Account to contact phone number is updating fine. similorly Contact to Account also needs to be update.Please tell me how to do that. It will great help for us.
Thanks
This is where the question of Multiple Contacts come.
If we start updating Account Phone # on Update of any Contact this would change the data. So it would be better if we could get the requirement clear.
Please mark the above answer as best if it was helpfull to you!!