You need to sign in to do that
Don't have an account?
srikanth11
bulkify trigger issue urgent
hi all i have written this trigger and it is working for one insert and update of a record at a time but when i am bulk inserting records 50 or 60 at a time its not working some one plz check my code and help me how to change my trigger to bulkify it. this is my trigger
trigger updatefundtotal on opportunity(after insert, after update) { Decimal id2num =0.0; for(opportunity o:trigger.new) { fund__c f=[select id ,Current_AUM__c from fund__c where id=:o.fund__c]; opportunity[] opp=[select ID,Name,amount,Fund__r.Current_AUM__c from opportunity where fund__c=:f.ID and stagename='booked']; for(opportunity opp1:opp) { id2num =opp1.amount + id2num; f.Current_AUM__c = id2num ; } update f; } }
Hi,
you can use your bulkfy triiger below here
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
All Answers
Hi,
you can use your bulkfy triiger below here
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
thats a great help jain anf i have changed update f2 to f as its throwing an error but the functionality is working but i could not exactly understand whats happening and how exactly it got bulkified hope u give me some points on it so i can use it for my furthur triggers