I have a trigger on the opportunity object with the below format:
Before Update on Opportunity
- Create List of ID's
- Create Set Using SOQL Query
- Create Map Using SOQL Query
Iterate over Opportunities in Trigger If conditions are met - do something If some other conditions are met - do something else
- Update List
This works fine, however every time a user edits an opportunity, 2 SOQL queries are going to be run. Is there a way to only execute the trigger if a condition is met (in this case, a checkbox on the opp == true)?
Many thanks in advance