You need to sign in to do that
Don't have an account?
Sfdc Siva
Writing Trigger help
Hi All,
We have one Formula field called "Contract End Date" in Opportunity object ,Needs to populate the "Contract End Date" on the Account "Service Contract End Date" at the time of opp is created.
Can any one please help me to creating a trigger on above senario.
Thanks
We have one Formula field called "Contract End Date" in Opportunity object ,Needs to populate the "Contract End Date" on the Account "Service Contract End Date" at the time of opp is created.
Can any one please help me to creating a trigger on above senario.
Thanks
list<ID> lstid = new list<ID>();
list<Account> lstacc = new list<Account>();
for(Opportunity opp: trigger.new){
lstid.add(opp.AccountId);
}
for(Account acc : [select id, ContractEndDate__c from Account where ID IN: lstid]){
for(Opportunity co : trigger.new){
acc.ServiceContractEndDate__c = co.ContractEndDate__c ;
lstacc.add(co);
}
}
upsert lstacc;
}