I want to Update Website(custom field) in opportunity by filling the same value in Website(standard field) in Account.Here by entering the value in Account website it should populate in the opportunity website field with same value.using trigger how can i do thistrigger
accountTrigger on Account (after Insert, after Update) {
List <Account> acc = new <Account>();
acc = trigger.new();
List <Opportunity> opp;
for(Account acc:acclist) {
opp=[select id,Website__c from Opportunity where Account id=acc.id]
for(Opportunity op:opp) {
op.Website__c=ac.Website;
}
}
}
Opportunity
object to retrieve the value from the parentAccount
object and writing that value to theWebsite__c
field on theOpportunity
record?