How does FIELDS(ALL), FIELDS(STANDARD), and FIELDS(CUSTOM) work in SOQL, and what are their limitations in Apex?
Answer
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