bcquality/microsoft/knowledge
Jesper Schulz-Wedde 3e848d1ec2
knowledge(performance): align SetLoadFields placement with AL Guidelines (#130)
* knowledge(performance): align SetLoadFields placement with AL Guidelines (#120)

The AL Guidelines mark `SetLoadFields` placed before `SetRange`/`SetFilter`
as bad code and recommend filters first, while the BCQuality samples used
the opposite order — contradictory guidance across two Microsoft repos.

Per Learn (`Record.SetLoadFields`), "fields that are filtered upon are
always loaded", so the two orders produce an identical projection. The
upstream rule is a readability convention: keep `SetLoadFields` adjacent
to the read it governs.

- Reorder filters ahead of `SetLoadFields` in the six affected AL samples.
- State the placement convention in the Best Practice section.
- Record in Description that order does not change the projection, and
  that only a fieldless `SetLoadFields()` or a later overwriting call does.
- Add an Anti Pattern note so review agents treat the reverse order as a
  readability observation, never a performance defect.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Clarify partial-record projection changes

Document AddLoadFields, SetBaseLoadFields, and Reset alongside SetLoadFields so the statement-order guidance does not imply those APIs leave the projection unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 89dba8c8-6529-4b60-956f-875a59be499d

---------

Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 89dba8c8-6529-4b60-956f-875a59be499d
2026-09-02 14:44:09 +02:00
..
appsource knowledge: three false-positive guards from BCApps PR 10277, 10278 and 10346 (#146) 2026-09-02 11:25:19 +02:00
breaking-changes knowledge(breaking-changes): adding a parameter to an event publisher is not a signature break (#139) 2026-09-02 09:24:54 +02:00
data-modeling knowledge: three false-positive guards from BCApps PR 10277, 10278 and 10346 (#146) 2026-09-02 11:25:19 +02:00
error-handling knowledge: improve review precision from BCApps PR 10080 feedback (#128) 2026-09-02 11:16:30 +02:00
events Add FP guards for field relocation to tableextension and event parameter addition 2026-08-04 10:41:03 +02:00
interfaces Add P0 event and interface compatibility knowledge (#98) 2026-07-14 12:51:59 +02:00
performance knowledge(performance): align SetLoadFields placement with AL Guidelines (#130) 2026-09-02 14:44:09 +02:00
privacy Scope tableextension requirement to Normal fields lacking a classification 2026-08-17 15:25:14 +02:00
query Complete AL review knowledge readiness (#108) 2026-07-15 10:55:25 +02:00
security Complete AL review knowledge readiness (#108) 2026-07-15 10:55:25 +02:00
style knowledge(style): event subscribers bind by parameter name, so a shorter list is not a mismatch (#138) 2026-08-28 11:07:05 +02:00
telemetry Complete AL review knowledge readiness (#108) 2026-07-15 10:55:25 +02:00
testing knowledge: three false-positive guards from BCApps PR 10277, 10278 and 10346 (#146) 2026-09-02 11:25:19 +02:00
ui Add batch-2 FP guards: sentence-case action captions + primary-key Get is transaction-cached 2026-07-21 11:08:04 +02:00
upgrade knowledge: add 3 FP-suppression guards from BC apps negative feedback 2026-07-21 09:45:09 +02:00
web-services Add P0 integration and control add-in runtime guidance (#100) 2026-07-14 12:53:26 +02:00
.gitkeep Add .gitkeep files to community and microsoft directories; remove .gitkeep from samples 2026-04-17 06:03:14 +02:00