Development questions
How does FIELDS(ALL), FIELDS(STANDARD), and FIELDS(CUSTOM) work in SOQL, and what are their limitations in Apex?
FIELDS() avoids listing every field:
FIELDS(STANDARD): all standard fieldsFIELDS(CUSTOM): all custom fieldsFIELDS(ALL): all fields
soql
SELECT FIELDS(ALL) FROM Account LIMIT 200
Limitations: FIELDS(ALL) and FIELDS(CUSTOM) require LIMIT 200 or less in Apex and most contexts (STANDARD has no such limit); you can't use them in subqueries or nested selects, and heavy use increases heap and query cost. For production code, selecting explicit fields is still recommended.
soqlfields
More Development questions
- What is an Apex Trigger in Salesforce and when should you use it over Flows?
- What is the difference between before triggers and after triggers?
- Explain all Trigger context variables (isInsert, isUpdate, isDelete, isUndelete, isBefore, isAfter, isExecuting, size, operationType).
- What is the difference between Trigger.new and Trigger.old?
- In which trigger events are Trigger.new and Trigger.newMap available?
- In which trigger events are Trigger.old and Trigger.oldMap available?