Im trying to update child record in parent after trigger, where i need to update this child's boolean (MA_Campaign_Qty_Boolean__c) as part of restricting some validation in child's trigger for this execution. Is this a solution advisable in terms of governor limits of execution time etc? enter image description here

  • 2
    First step would be to remove the update from the loop, and instead add them to a list variable and do an update on that outside the loop. Have a look at the Apex best practices: developer.salesforce.com/page/Apex_Code_Best_Practices – Folkert Nov 17 '17 at 13:46
  • 1
    ... so for your example one loop to set to true, then the update of the whole list then one loop to set to false. There are probably other ways to achieve your aim. – Keith C Nov 17 '17 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.