Salesforce PDII Question Answer
Consider the following code snippet:78
Java
trigger OpportunityTrigger on Opportunity (before insert, before update) {
for(Opportunity opp : Trigger.new){
OpportunityHandler.setPricingStructure(Opp);
}
}
public class OpportunityHandler{
public static void setPricingStructure(Opportunity thisOpp){
Pricing_Structure_c ps = [Select Type_c FROM Pricing_Structure_c WHERE industry_c = :thisOpp.Account_Industry_c];
thisOpp.Pricing_Structure_c = ps.Type_c;
update thisOpp;
}
}
Which two best practices should the developer implement to optimize this code?
Salesforce PDII Summary
- Vendor: Salesforce
- Product: PDII
- Update on: Dec 26, 2025
- Questions: 161

