AI Associate AI Capabilities in CRM Practice Question
Exhibit
Apex Trigger:
trigger LeadScoringTrigger on Lead (after insert) {
for(Lead l : Trigger.new) {
l.Score__c = Einstein_Prediction_API.predict('Lead_Score', l.Id);
}
}Refer to the exhibit. A developer wrote a trigger to call an Einstein prediction API on lead insert. When new leads are created, the trigger fails with a 'Too many SOQL queries' error. What is the most likely cause?
⚠ Common exam trap
Salesforce often tests the misconception that 'Too many SOQL queries' always means too many SOQL queries, but in this context it actually masks a callout limit issue—candidates may overlook the fact that API calls count against a different governor limit that produces the same error message.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The trigger is making API calls in a loop, causing governor limit issues
The trigger is making synchronous API calls to the Einstein prediction service inside a loop that iterates over each new lead. Each API call counts against the 'Number of callouts' governor limit (default 100 per transaction), and if more leads are inserted than the limit allows, the transaction fails with a 'Too many SOQL queries' error—though the error message is misleading, the root cause is exceeding the callout limit, not SOQL queries. The trigger should batch the API calls or use asynchronous processing to stay within limits.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The trigger is executed before the lead is saved
Why it's wrong here
It's after insert, so lead is saved.
- ✗
The trigger is querying a related object without an index
Why it's wrong here
No query is shown; the trigger uses API call.
- ✓
The trigger is making API calls in a loop, causing governor limit issues
Why this is correct
Looping API calls can exceed limits.
- ✗
The Score__c field is not writeable
Why it's wrong here
The error is not about field writeability.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AI Associate question from scratch — 753 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AI Associate practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI Associate exam.