3 answers
Hi,I created a trigger in custom object and i achived this one, Here the trigger i tried,
Thanks & Regards,Karthikeyan Chandran+91-9944676540trigger PrimeBaseRate on Prime_Rate__c (after update, after insert) {
Static Double x;
for(Prime_Rate__c pr : trigger.new){
x= pr.Prime_Base_Rate__c;
}
System.debug('the vaulue of field is '+x);
//created a new list for bulkifying
list<opportunity> op = new list <opportunity>();
//running for loop for entire table.
for(opportunity op1 : [select id, Base_Rate__c from opportunity where isclosed=false]){
//changing the value of the field with the static variable.
op1.Base_Rate__c=x;
op.add(op1);
}
update op;
}