問題文
Inside an after update trigger on Shipment__c, code needs to compare each record's new carrier value with its previous value. Which context variable choice lets the code look up the old version of a specific record by its identifier?
選択肢
- Query the object inside the loop, because the old version is not available in an after update trigger, and the query returns the value as it stood just before the save.
- Iterate the new records and read the matching previous version from the map of old records, keyed by the record identifier, because the map of old records is keyed by identifier for exactly this lookup, while a position in a list is only incidental.
- Read the old value from the same record instance in the new list, because during an update the platform keeps both versions on one object and exposes the previous value through a separate accessor on each field of the row.
- Iterate both lists with the same index, because the platform guarantees that the list of new records and the list of old records are in the same order, and the pairing holds for a bulk save.