My trigger works on one record but fails when I data-load 200. I'm three lessons into Apex basics — explain what's happening, then give me a route to Platform Developer I.
My trigger works on one record but fails when I data-load 200. I'm three lessons into Apex basics — explain what's happening, then give me a route to Platform Developer I.
Your trigger is written for one record at a time. Salesforce hands a trigger up to 200 records in a single call, so anything you do inside the loop — a SOQL query, a DML statement — runs 200 times and blows the per-transaction limit (100 queries, 150 DML statements).
The fix is the same every time: query once before the loop into a Map, and collect changes into a List you insert once after it.
// one query, outside the loopMap<Id, Account> parents = new Map<Id, Account>([SELECT Id, Rating FROM Account]);for (Contact c : Trigger.new) { c.Description = parents.get(c.AccountId).Rating;}
Test it with 200 records, not one [1] — a test that inserts a single row proves nothing about the case that broke.
Covers this, in order
Good. Any project I could build and put on my resume?
Drafting project ideas
Read your progress Searching projects
Three that map to what you have already built, hardest last. Each one is a real org artefact you can screenshot and talk through in an interview
Could not reach the catalog
The answer above is written from what I already know about your progress; the project list needs the catalog and it did not respond. Nothing you typed was lost.
The assistant can be wrong. Check anything it says against the lesson it cites.