# BC Observatory: Quality rules > Microsoft's BCQuality knowledge base for AL (microsoft/BCQuality, MIT): each rule and review skill as a page with its own text, > its good and bad examples, the objects and Learn pages it names and the pull requests that changed it. Frontmatter: schemas/frontmatter.guideline.json. 485 rules and review skills, by domain. ## performance - [A FlowField needs a source-table key that covers its CalcFormula](microsoft/knowledge/performance/flowfield-source-key-needs-sumindexfields.md): A FlowField is computed by SQL on demand. (microsoft) - [A page or lookup's effective filter may be defined outside the changed hunk](microsoft/knowledge/performance/page-effective-filter-may-live-outside-the-diff.md): The effective filter on a drill-down, lookup, or list result set is frequently defined outside any single changed hunk — on the table via a SourceTableView property or a TableRelation, or through SetRange/SetFilter calls in unchanged code that runs before the result is shown. (microsoft) - [A primary-key Get() in a per-row helper is not an N+1 to cache manually](microsoft/knowledge/performance/primary-key-get-in-loop-is-transaction-cached.md): The Business Central server caches primary-key reads within a transaction. (microsoft) - [Add trigger-only fields to API pages with AddLoadFields in OnOpenPage](microsoft/knowledge/performance/addloadfields-for-trigger-only-fields-on-api-pages.md): API and OData pages load only the fields bound to page controls, so a field read only in trigger code triggers JIT loads. (microsoft) - [Add trigger-only report fields in OnPreDataItem](microsoft/knowledge/performance/addloadfields-in-report-onpredataitem.md): Report dataitem field selection is calculated at compile time and once per dataitem type during execution. (microsoft) - [Admin and migration pages tolerate lower performance discipline](microsoft/knowledge/performance/admin-and-migration-pages-tolerate-lower-perf.md): Some pages run rarely and against small datasets, and the upstream guidance explicitly calls for treating them as lower severity. (microsoft) - [Aggregate source rows before persisting completed results](microsoft/knowledge/performance/aggregate-before-persisting-intermediate-results.md): A batch may repeatedly calculate the same group total while inserting and updating persistent working rows, even though only one completed result per group is needed. (microsoft) - [AL auto-commits when code execution completes](microsoft/knowledge/performance/understand-implicit-transaction-boundary.md): In AL, write transactions are managed by the runtime, not by the developer. (microsoft) - [AL boolean operators do not short-circuit](microsoft/knowledge/performance/boolean-operators-do-not-short-circuit.md): AL gives no short-circuit (lazy) evaluation guarantee for and, or, and xor: every operand of a boolean expression is evaluated, even when the leftmost operand already determines the result. (microsoft) - [AL methods limited during write transactions: commit before RunModal and Codeunit.Run](microsoft/knowledge/performance/al-methods-limited-during-write-transactions.md): Once AL code has written to the database in the current transaction — an Insert, Modify, or Delete with no Commit since — the platform restricts four methods until that transaction is committed. (microsoft) - [Apply early-exit guards before calling Get](microsoft/knowledge/performance/apply-guards-before-get.md): A Get (or any other database call) executed before a guard that may exit the procedure does a round-trip the procedure never uses. (microsoft) - [Apply SetRange/SetFilter before iterating, not as an if-test inside the loop](microsoft/knowledge/performance/apply-filters-before-iterating.md): A SetRange or SetFilter placed before FindSet narrows the result set at the database. (microsoft) - [Avoid cloning records before Modify or Delete in loops](microsoft/knowledge/performance/avoid-cloning-records-before-modify-delete-in-loops.md): Microsoft's AL database-method performance guidance states that cloning an iterated record before Modify or Delete restarts the SQL SELECT and issues an extra SQL statement for every row. (microsoft) - [Avoid Get / FindFirst inside a loop on a large inner table](microsoft/knowledge/performance/avoid-get-inside-loop-on-large-table.md): A Get or FindFirst against another persistent table inside a loop can produce an N+1 access pattern: one outer query followed by repeated inner lookups. (microsoft) - [Avoid growing globals in SingleInstance subscribers](microsoft/knowledge/performance/avoid-growing-globals-in-singleinstance-subscribers.md): A codeunit with SingleInstance = true is allocated once per session and lives until the session ends. (microsoft) - [Avoid RecordRef / FieldRef in hot loops when a typed record fits](microsoft/knowledge/performance/avoid-recordref-in-hot-loop.md): RecordRef and FieldRef are slower than direct typed record access — the platform resolves the table and field at runtime instead of at compile time. (microsoft) - [Avoid repeating validation when its inputs have not changed](microsoft/knowledge/performance/avoid-repeating-unchanged-validation.md): Validate runs field validation logic, which can invoke subscribers and additional reads or writes even if the assigned value is unchanged. (microsoft) - [Batch number-series calls instead of GetNextNo per insert](microsoft/knowledge/performance/batch-number-series-instead-of-getnextno-per-row.md): Codeunit "No. (microsoft) - [CalcFields in both OnAfterGetRecord and OnAfterGetCurrRecord is not redundant](microsoft/knowledge/performance/calcfields-in-both-getrecord-triggers-is-not-redundant.md): OnAfterGetRecord fires once per row as the page loads records into the view; OnAfterGetCurrRecord fires when a record becomes the active/current record. (microsoft) - [Calculate expensive cues on a page background task](microsoft/knowledge/performance/page-background-tasks-for-expensive-cues.md): Role-center cues and CardPart totals that run CalcFields, scans, or HTTP on the UI thread freeze the shell until they finish. (microsoft) - [Choose MaintainSIFTIndex by read-write ratio](microsoft/knowledge/performance/choose-maintainsiftindex-by-read-write-ratio.md): MaintainSIFTIndex on a key decides whether SQL Server maintains the SIFT indexed view as underlying rows change. (microsoft) - [Commit before Codeunit.Run when the caller already holds a write transaction](microsoft/knowledge/performance/codeunit-run-requires-prior-commit-inside-transaction.md): Codeunit.Run cannot nest inside an open write transaction. (microsoft) - [Compute data-driven Role Center headlines in the background, not when the page opens](microsoft/knowledge/performance/compute-role-center-headlines-in-the-background.md): Code in a headline part's OnOpenPage, or in a subscriber to an event raised from it, runs every time the Role Center opens. (microsoft) - [Database work in OnAfterGetCurrRecord is not a per-row or N+1 cost](microsoft/knowledge/performance/onaftergetcurrrecord-is-not-per-row.md): OnAfterGetCurrRecord fires only when the current/active record changes — typically once when the page opens and once each time the user selects a different row — not once for every row rendered in a list. (microsoft) - [Design a read-pattern key and verify whether it covers the query](microsoft/knowledge/performance/design-covering-keys-from-read-pattern.md): A secondary key should serve a particular read, not a list of fields that happen to look important. (microsoft) - [Do not call ChangeCompany inside a per-row loop](microsoft/knowledge/performance/changecompany-in-loop-drops-caches.md): ChangeCompany retargets a record variable to another company's data and drops the in-memory caches bound to the previous company. (microsoft) - [Do not call CurrPage.Update inside OnAfterGetRecord](microsoft/knowledge/performance/avoid-currpage-update-in-onaftergetrecord.md): OnAfterGetRecord on a list already runs once per visible row on scroll and refresh. (microsoft) - [Do not call HttpClient inside an open write transaction](microsoft/knowledge/performance/httpclient-inside-write-transaction-holds-locks.md): The first database write opens an AL write transaction that the runtime holds until the execution completes or Commit() runs — see understand-implicit-transaction-boundary.md. (microsoft) - [Do not Commit inside loops](microsoft/knowledge/performance/avoid-commit-inside-loops.md): Commit ends the current write transaction. (microsoft) - [Do not Get the record the page already loaded](microsoft/knowledge/performance/avoid-redundant-get-when-record-already-loaded.md): A list or card page's OnAfterGetRecord trigger fires *because* the platform has already fetched a row into Rec. (microsoft) - [Do not hold locks while waiting for the user](microsoft/knowledge/performance/avoid-user-prompts-inside-transactions.md): A Confirm, StrMenu, or other user prompt issued from inside a write transaction stalls the transaction — and therefore every lock it holds — until the user responds. (microsoft) - [Do not LockTable in a read-only procedure](microsoft/knowledge/performance/do-not-locktable-in-read-only-procedure.md): LockTable is a transaction-wide signal: from the call onward, every read against that table in the same transaction acquires UPDLOCK. (microsoft) - [Do not Modify inside OnAfterGetRecord](microsoft/knowledge/performance/do-not-modify-in-onaftergetrecord.md): A list page's OnAfterGetRecord fires once per visible row, every time the user scrolls, sorts, or refreshes. (microsoft) - [Document reports should default to a Word layout, not RDLC](microsoft/knowledge/performance/document-report-word-layout.md): For a document report — an invoice, statement, order confirmation, or any report meant to be printed, emailed, or exported as a single-record document — Microsoft's own guidance recommends a Word rendering layout over RDLC: "RDL layouts can result in slower performance with document reports,… (microsoft) - [Enforced singleton setup tables need no access optimization](microsoft/knowledge/performance/singleton-setup-tables-need-no-access-optimization.md): An access-pattern exemption is valid only for a table whose schema and write paths enforce at most one row for the relevant scope. (microsoft) - [FindSet(true) applies UpdLock on the read; the two-parameter form is obsolete](microsoft/knowledge/performance/findset-true-applies-updlock-on-read.md): FindSet() and FindSet(false) are read-only — no locking. (microsoft) - [Guard event subscribers with cheap checks before any database call](microsoft/knowledge/performance/guard-event-subscribers-before-db-call.md): Event subscribers fire on every event matching their signature — for OnAfterValidateEvent on a hot field like Sales Line.Quantity, that is every quantity edit by every user. (microsoft) - [Guard page trigger work with GuiAllowed for OData and Excel](microsoft/knowledge/performance/guiallowed-guard-on-pages-used-as-odata.md): Pages exposed as OData, including Edit in Excel, still run AL page triggers for every row returned. (microsoft) - [Hidden page FlowFields still calculate unless visible-only calculation is enabled](microsoft/knowledge/performance/hidden-flowfields-still-calculate-before-bc26-opt-in.md): By default, a FlowField used directly as a page control's source is calculated when the page loads even when Visible = false or its visibility expression evaluates to false. (microsoft) - [IsEmpty immediately before FindSet is an extra round-trip](microsoft/knowledge/performance/isempty-before-findset-is-extra-round-trip.md): IsEmpty is the right API when the caller only needs existence — see microsoft/knowledge/performance/use-isempty-for-existence-check.md. (microsoft) - [Job queue external effects must be idempotent](microsoft/knowledge/performance/job-queue-external-effects-must-be-idempotent.md): A job queue handler can successfully create something in an external system and then fail while updating Business Central. (microsoft) - [Job queue handlers must not require user interaction](microsoft/knowledge/performance/job-queue-handlers-must-not-require-ui.md): A job queue handler runs in a background session with no client UI. (microsoft) - [Job queue handlers must propagate execution failures](microsoft/knowledge/performance/job-queue-handlers-must-propagate-failures.md): The job queue dispatcher can mark an entry as failed, record the error, and apply its configured retry behavior only when the handler terminates with an error. (microsoft) - [Justify low-selectivity fields in key columns](microsoft/knowledge/performance/justify-low-selectivity-fields-in-key-columns.md): A Boolean, small Option/Enum, or status field (Processed, Blocked, Status) in a key is a cost that needs a reason. (microsoft) - [Keep eligible inserts together instead of re-reading their target](microsoft/knowledge/performance/preserve-buffered-inserts-by-separating-target-reads.md): Business Central can automatically buffer eligible Insert calls. (microsoft) - [Load common fields before branching on case](microsoft/knowledge/performance/load-common-fields-before-branching-on-case.md): When a known input determines which fields a subsequent record read will use, a single SetLoadFields containing every branch's fields loads unnecessary columns. (microsoft) - [Load only primary key fields for reference work](microsoft/knowledge/performance/load-only-primary-key-fields-for-reference-work.md): Work that uses a record only for its identity — passing it to another procedure that will re-fetch what it needs, queueing a key for later processing, running existence checks, or building a reference collection — does not need non-key payload fields. (microsoft) - [MaintainSQLIndex = false on a key disables SIFT for FlowFields that depend on it](microsoft/knowledge/performance/maintainsqlindex-false-breaks-flowfield-sift.md): MaintainSQLIndex = false on a key tells the platform not to materialize that key as a SQL index. (microsoft) - [Order case branches by frequency](microsoft/knowledge/performance/order-case-branches-by-frequency.md): AL documentation does not guarantee that a case statement uses a linear comparison strategy, so branch frequency alone is not proof of a performance issue. (microsoft) - [Pass false to Insert/Modify/Delete when the table triggers do not need to fire](microsoft/knowledge/performance/pass-false-to-insert-when-trigger-not-needed.md): Insert(true), Modify(true), and Delete(true) run the table's OnInsert/OnModify/OnDelete trigger; the (false) form skips it. (microsoft) - [Pass the iterated record var so a JIT load updates the enumerator](microsoft/knowledge/performance/pass-var-record-to-preserve-partial-load-enumerator.md): A FindSet/Next loop builds an enumerator from the fields selected for load. (microsoft) - [Point lookups at a dedicated lookup page, not the full list](microsoft/knowledge/performance/use-dedicated-lookup-pages-not-full-lists.md): A TableRelation lookup opens the table's LookupPageId. (microsoft) - [Prefer a Dictionary over a temporary table for pure lookups](microsoft/knowledge/performance/prefer-dictionary-over-temporary-table-for-lookups.md): An AL Dictionary directly models an unordered unique key-to-value collection. (microsoft) - [Prefer a related table over stored fields on hot ledgers](microsoft/knowledge/performance/prefer-related-table-over-extension-on-hot-ledgers.md): Since v23, all extensions on the same base table share at most one companion-table join, and the platform automatically excludes that join on List, ListPart, and OData pages when partial records are in effect and no extension field is loaded. (microsoft) - [Prefer ReadIsolation over LockTable for read-only scenarios](microsoft/knowledge/performance/prefer-readisolation-over-locktable-for-reads.md): Without read scale-out, LockTable causes subsequent reads of that table in the transaction to use UPDLOCK. (microsoft) - [Putting a job queue entry on hold does not stop its current run](microsoft/knowledge/performance/job-queue-on-hold-does-not-stop-running-work.md): The On Hold status prevents a job queue entry from starting again, but it does not cancel a run that is already in process. (microsoft) - [Query results bypass the primary-key cache](microsoft/knowledge/performance/query-results-bypass-primary-key-cache.md): The Business Central server caches primary-key Get calls within a transaction. (microsoft) - [Removing SourceTableTemporary on an API page switches it from in-memory to persistent](microsoft/knowledge/performance/do-not-remove-sourcetabletemporary-from-api-page.md): SourceTableTemporary = true on a page makes the page's record buffer in-memory only — reads and writes do not touch SQL. (microsoft) - [Reset and empty SetLoadFields restore a full-row load](microsoft/knowledge/performance/reset-clears-partial-record-selection.md): SetLoadFields(...) sticks to the record variable until something clears it. (microsoft) - [Reuse repeated filtered results within a correct cache scope](microsoft/knowledge/performance/cache-repeated-filtered-results-with-explicit-scope.md): A loop can ask the same filtered existence or calculation question for many rows sharing a business key, or two phases can ask it for the same rows. (microsoft) - [Review overlapping keys as a portfolio](microsoft/knowledge/performance/review-overlapping-keys-before-adding-an-index.md): Adding a secondary key to a frequently written table maintains another SQL index for every affected write. (microsoft) - [Session-open subscribers must not do I/O](microsoft/knowledge/performance/oncompanyopen-subscribers-must-not-do-io.md): OnCompanyOpen, OnCompanyOpenCompleted, and System Initialization.OnAfterLogin run while the session is being created. (microsoft) - [Set DataAccessIntent ReadOnly on analytical objects](microsoft/knowledge/performance/dataaccessintent-readonly-on-analytical-objects.md): DataAccessIntent was introduced at runtime 5.0 (BC 16) and has no effect in earlier versions. (microsoft) - [SetCurrentKey is not a SQL index hint for record reads](microsoft/knowledge/performance/setcurrentkey-sets-sort-order-not-index-hint.md): A common misconception is that SetCurrentKey tells SQL Server which index to use for a filtered FindSet/FindFirst query. (microsoft) - [Skip SetLoadFields on write and copy paths](microsoft/knowledge/performance/skip-setloadfields-on-write-and-transferfields.md): SetLoadFields is a read optimization. (microsoft) - [Store the scheduled task ID to avoid duplicate tasks](microsoft/knowledge/performance/store-scheduled-task-id-to-avoid-duplicate-tasks.md): Every call to TaskScheduler.CreateTask creates a new scheduled task and returns its unique GUID. (microsoft) - [Temporary tables avoid SQL I/O, not in-memory work](microsoft/knowledge/performance/temporary-tables-have-no-database-cost.md): A temporary table stores its rows in Business Central Server memory instead of a physical SQL table. (microsoft) - [Triggers, subscribers, and media fields can silently regress ModifyAll / DeleteAll](microsoft/knowledge/performance/triggers-and-media-field-regress-modifyall.md): ModifyAll and DeleteAll can limit SQL calls, but Microsoft documents that they revert to individual calls when the table has trigger code, related modify/delete/global/database event subscribers, active security filtering, Media or MediaSet fields, or fields added through companion tables. (microsoft) - [Use \[TryFunction\] for error catching, Codeunit.Run for atomic rollback](microsoft/knowledge/performance/use-tryfunction-for-error-catching-not-rollback.md): \[TryFunction\] lets a caller catch an error, but database changes made before that error are not rolled back. (microsoft) - [Use a grouped query for distinct values and duplicate detection](microsoft/knowledge/performance/use-grouped-query-for-distinct-values-and-duplicates.md): The AL Record type has no SELECT DISTINCT or GROUP BY ... (microsoft) - [Use a job queue category to serialize conflicting jobs](microsoft/knowledge/performance/job-queue-category-code-serializes-conflicting-jobs.md): Different job queue entries can run at the same time. (microsoft) - [Use AL TextBuilder for repeated text mutation](microsoft/knowledge/performance/use-textbuilder-for-string-concatenation-in-loops.md): AL TextBuilder is a reference type intended for modifying text without creating a new Text value for each change. (microsoft) - [Use CalcSums for stored-field totals, not as a shortcut for FlowFields](microsoft/knowledge/performance/calcsums-instead-of-calcfields-in-loop.md): CalcFields evaluates a FlowField for one record; CalcSums totals stored numeric fields in a filtered source table. (microsoft) - [Use case true of for long chains of dependent conditions](microsoft/knowledge/performance/case-true-of-for-long-condition-chains.md): Because AL gives no short-circuit guarantee for and and or, a chain of conditions that must be evaluated in order has to be sequenced with nested if statements — and past three conditions the nesting itself becomes the problem: the body drifts right, the order of evaluation is carried by… (microsoft) - [Use Codeunit.Run to bound an atomic sub-operation](microsoft/knowledge/performance/codeunit-run-as-atomic-sub-operation.md): Codeunit.Run(ID) is the AL-idiomatic way to run a unit of work as an atomic sub-operation with its own transactional boundary. (microsoft) - [Use DeleteAll for filtered bulk deletion](microsoft/knowledge/performance/use-deleteall-for-filtered-bulk-deletion.md): DeleteAll(false) is eligible for a set-based SQL delete with the record variable's filters applied, but it is not guaranteed to stay one statement. (microsoft) - [Use FindSet with repeat..Next; do not pair FindFirst/FindLast/Get with Next](microsoft/knowledge/performance/pair-findset-with-next-loop.md): Two CodeCop rules carve out the loop pattern. (microsoft) - [Use Get for primary-key lookups without losing filter conditions](microsoft/knowledge/performance/use-get-instead-of-findfirst-on-full-primary-key.md): Get(...) retrieves a record by primary key, but ignores normal record filters. (microsoft) - [Use IsEmpty for existence checks, not Count() or FindFirst()](microsoft/knowledge/performance/use-isempty-for-existence-check.md): When the caller only needs to know whether any row matches a filter, IsEmpty() is the API designed for the question. (microsoft) - [Use ModifyAll only for equivalent bulk assignments](microsoft/knowledge/performance/prefer-modifyall-over-per-row-modify.md): ModifyAll assigns one value to one field across the filtered set. (microsoft) - [Use SetAutoCalcFields when each iterated row needs a FlowField](microsoft/knowledge/performance/use-setautocalcfields-for-per-row-flowfields.md): Record.SetAutoCalcFields has been available since runtime 1.0 and makes the specified FlowFields calculate as records are retrieved. (microsoft) - [Use SetLoadFields to load only the fields the code reads](microsoft/knowledge/performance/use-setloadfields-for-partial-records.md): SetLoadFields(...) declares the subset of normal fields the next read should materialize. (microsoft) - [Validate on a partial record forces JIT loads](microsoft/knowledge/performance/validate-on-partial-record-forces-jit.md): Validate runs the field's OnValidate trigger and TableRelation lookups. (microsoft) ## ui - [A `DropDown` field remains hidden when its lookup-page control is hidden](microsoft/knowledge/ui/dropdown-fieldgroup-respects-lookup-page-visibility.md): A tableextension can append a field to the DropDown field group with addlast, but the client still omits that field when its control on the underlying lookup page has Visible = false. (microsoft) - [A notification that must be recalled needs an Id the code can find again](microsoft/knowledge/ui/notification-recall-needs-known-id.md): Notification.Recall() withdraws the notification whose Id it carries. (microsoft) - [A page field bound to a table field inherits that field's ToolTip](microsoft/knowledge/ui/bound-page-field-inherits-source-field-tooltip.md): Starting with BC24 (2024 release wave 1), runtime 13.0 supports ToolTip on table fields. (microsoft) - [A wizard collects its input in a temporary source table and saves on Finish](microsoft/knowledge/ui/wizard-collects-input-in-a-temporary-source-table.md): An assisted setup guide is a NavigatePage that the user can leave at any step. (microsoft) - [An app has at most one primary setup object in Guided Experience](microsoft/knowledge/ui/one-primary-guided-experience-setup-per-app.md): An extension tells Business Central which setup objects it brings by adding them as guided experience items through codeunit Guided Experience. (microsoft) - [Control add-in accessibility is the developer's responsibility](microsoft/knowledge/ui/control-add-in-accessibility-is-developer-responsibility.md): When a developer builds a JavaScript control add-in, they bypass the Business Central framework's built-in accessibility support and take full responsibility for the accessibility of the rendered HTML, JavaScript, and CSS. (microsoft) - [Control add-ins cannot use BC color tokens or theming](microsoft/knowledge/ui/control-add-in-has-no-bc-color-tokens.md): A JavaScript control add-in has no access to Business Central's color tokens or theming system. (microsoft) - [Cosmetic styles need no textual context](microsoft/knowledge/ui/cosmetic-styles-need-no-textual-context.md): A field's Style property controls text formatting. (microsoft) - [Default descending sort on historical pages](microsoft/knowledge/ui/default-descending-sort-on-historical-pages.md): Historical list pages should default to showing the newest records first. (microsoft) - [Define per-record page outputs on every control-flow path](microsoft/knowledge/ui/reset-per-row-page-variables-in-onaftergetrecord.md): A global page variable belongs to the page instance, whereas Rec changes as OnAfterGetRecord processes records. (microsoft) - [Expose setup that lives on a base page through a codeunit](microsoft/knowledge/ui/expose-base-page-setup-through-a-codeunit.md): Guided experience items carry the ID of the extension that registered them, which is how Business Central lists the setup an app brings and runs it from Extension Management. (microsoft) - [Filter ListPart FactBoxes With SubPageLink To The Parent Record](microsoft/knowledge/ui/factbox-design.md): A FactBox is a page part that surfaces related data beside the main record so users avoid navigating away. (microsoft) - [Gate Role Center content by permission with AccessByPermission](microsoft/knowledge/ui/rolecenter-permission-gating-must-use-accessbypermission.md): A page of type RoleCenter cannot have triggers (AL0378, error) or procedures (AL0569, warning that will become an error), and the AL compiler applies both rules to a pageextension whose target is a Role Center. (microsoft) - [Grid and fixed-layout data-table heuristic](microsoft/knowledge/ui/grid-data-table-heuristic.md): Business Central renders grid() and fixed() layouts in two modes. (microsoft) - [Group caption quality is not an accessibility issue](microsoft/knowledge/ui/group-caption-quality-is-not-an-accessibility-issue.md): Group captions affect page organization, but missing, generic, or duplicate group captions are not accessibility violations per the BC accessibility rules. (microsoft) - [Group ShowCaption = false outside grid/fixed is a layout choice](microsoft/knowledge/ui/group-show-caption-false-outside-grid-is-not-a-violation.md): In a standard Card or Document page, a group with ShowCaption = false is a layout choice, not an accessibility violation. (microsoft) - [Group-labeled first child exception](microsoft/knowledge/ui/group-labeled-first-child-exception.md): ShowCaption = false is acceptable on an editable field only when all of the following conditions are met: (microsoft) - [Layout-table grids with visible captions are valid](microsoft/knowledge/ui/layout-table-with-captions-is-valid.md): A grid or fixed layout that does not meet all three data-table conditions renders as a layout table. (microsoft) - [Load packaged control add-in resources with credentialed AJAX](microsoft/knowledge/ui/control-addin-package-resource-ajax-needs-withcredentials.md): JavaScript in a Business Central control add-in can load a static resource from its extension package with AJAX, but the request needs the Business Central context and cookies. (microsoft) - [Mark code-required page fields with ShowMandatory](microsoft/knowledge/ui/showmandatory-on-code-required-page-fields.md): ShowMandatory draws the red asterisk on a page field and, per the platform documentation, enforces no validation. (microsoft) - [Nested grids are not supported](microsoft/knowledge/ui/no-nested-grids.md): A grid nested inside another grid is not a supported pattern in Business Central. (microsoft) - [Offload Slow Read-Only Page Calculations To Background Tasks](microsoft/knowledge/ui/page-background-tasks.md): Pages that compute statistics, aggregates, or external lookups inline block the page from rendering until the calculation finishes, producing a visible freeze on FactBoxes, cue tiles, and calculated fields. (microsoft) - [OnDrillDown on non-editable fields renders as a link](microsoft/knowledge/ui/on-drill-down-on-non-editable-fields-renders-as-link.md): The Business Central client renders non-editable fields that have an OnDrillDown trigger as HTML (anchor) elements. (microsoft) - [Open documents from a mixed-type list through Page Management](microsoft/knowledge/ui/list-page-document-routing-uses-page-management.md): Some tables back several document pages, chosen by a type field. (microsoft) - [Page client-expression properties must not use an `in \[...\]` list](microsoft/knowledge/ui/page-client-expression-must-not-use-in-list.md): Enabled, Visible, Editable, and StyleExpr on page controls (the list is not exhaustive; HideValue is rejected the same way) can be bound to a client expression instead of a literal. (microsoft) - [Pages must match one of Business Central's page-type conventions](microsoft/knowledge/ui/page-design-must-match-bc-page-type-conventions.md): Business Central's page types — RoleCenter, Card, List, CardPart, ListPart, Worksheet, Document, ListPlus, plus system dialog/special types such as NavigatePage, ConfirmationDialog, StandardDialog, HeadlinePart, and API (a selected list of conventional types this article covers design conventions… (microsoft) - [Preserve list scope after `SetSelectionFilter`](microsoft/knowledge/ui/set-selection-filter-list-scope.md): CurrPage.SetSelectionFilter(Rec) behaves differently depending on whether the user explicitly multi-selected rows. (microsoft) - [Promote Actions With The Modern `actionref` Syntax, Never The Legacy `Promoted` Properties](microsoft/knowledge/ui/prefer-actionref-syntax-for-promoted-actions.md): Business Central 2022 release wave 2 (v21) introduced the area(Promoted) block with actionref as the way to promote page actions, separating an action's definition from its promotion. (microsoft) - [Register an assisted setup guide on every `OnRegisterAssistedSetup` event](microsoft/knowledge/ui/register-assisted-setup-on-every-registration-event.md): The Assisted Setup page lists the guides that are registered as guided experience items. (microsoft) - [Semantic styles in a cuegroup are auto-labeled](microsoft/knowledge/ui/semantic-style-in-cuegroup-exception.md): Fields inside a cuegroup render as cue tiles. (microsoft) - [Semantic styles need independent textual meaning](microsoft/knowledge/ui/semantic-styles-need-independent-textual-meaning.md): Three Style values carry semantic meaning through color and must be backed by text that conveys the same meaning: (microsoft) - [Sentence-phrase captions use sentence case, not title case](microsoft/knowledge/ui/caption-capitalization-noun-phrase-vs-sentence-phrase.md): Business Central caption capitalization depends on whether the caption reads as a noun phrase or a sentence/verb phrase. (microsoft) - [Serialize control add-in AL calls and keep payloads small](microsoft/knowledge/ui/control-addin-throttle-al-calls-and-payload-size.md): InvokeExtensibilityMethod crosses from a control add-in into the Business Central service. (microsoft) - [Set Field Importance To Drive FastTab Progressive Disclosure](microsoft/knowledge/ui/fasttab-field-importance.md): A FastTab field's Importance property controls whether the field is visible immediately, hidden behind "Show more", or surfaced on the collapsed FastTab header summary line. (microsoft) - [ShowCaption = false on non-editable fields](microsoft/knowledge/ui/show-caption-false-allowed-on-non-editable-fields.md): When a field is explicitly non-editable (Editable = false), it serves as content rather than as a form field. (microsoft) - [ShowCaption in a PromptDialog prompt area](microsoft/knowledge/ui/show-caption-in-promptdialog-prompt-area.md): On PageType = PromptDialog pages, input fields inside area(Prompt) are labeled by the dialog's heading — the page Caption. (microsoft) - [ShowCaption inside a repeater is harmless](microsoft/knowledge/ui/show-caption-in-repeater-allowed.md): Fields inside a repeater() control are labeled by their column headers, not by their own captions. (microsoft) - [ShowCaption on editable fields](microsoft/knowledge/ui/show-caption-on-editable-fields.md): ShowCaption must remain true (the default) on editable fields unless the field matches one of the officially supported "magic patterns". (microsoft) - [Standalone content in a layout-table grid](microsoft/knowledge/ui/standalone-content-in-layout-table.md): A non-editable field with ShowCaption = false is acceptable inside a layout-table grid only when the field is standalone content — it displays a value that is meaningful on its own (for example a status message or a description) and is not intended to label or be labeled by another field in the… (microsoft) - [StyleExpr: Boolean toggle vs Text variable](microsoft/knowledge/ui/style-expr-text-vs-boolean.md): StyleExpr on a page field serves two distinct purposes depending on its type: (microsoft) - [Tabular intent requires data-table conditions](microsoft/knowledge/ui/tabular-intent-requires-data-table-conditions.md): The most common accessibility bug in grid layouts is partially following the data-table conventions. (microsoft) - [Use `UpdatePropagation = Both` when line edits must refresh the main page](microsoft/knowledge/ui/updatepropagation-both-refreshes-main-page.md): A page part does not automatically refresh its parent page when the subpage changes. (microsoft) - [Use Standard Promoted Action Group Names And Placements](microsoft/knowledge/ui/promoted-action-groups.md): Business Central ships a fixed vocabulary of promoted action groups, and users build muscle memory around where each kind of action lives. (microsoft) - [Validate request-page input in OnQueryClosePage, not only in OnPreReport](microsoft/knowledge/ui/validate-request-page-input-in-onqueryclosepage.md): OnPreReport runs after the request page has closed and before the data items are processed. (microsoft) - [Wizard navigation actions need `InFooterBar` and the standard images](microsoft/knowledge/ui/navigatepage-footer-actions-need-infooterbar-and-standard-images.md): A page with PageType = NavigatePage is a wizard: it has no action bar, and the user moves through it with Back, Next, and Finish buttons at the bottom. (microsoft) ## style - [`APIVersion` must follow the pattern `vX.Y` (or `beta`)](microsoft/knowledge/style/api-page-version-format.md): The APIVersion property on an API page is part of the public URL path: /api////. (microsoft) - [`case` action goes on the line after the possibility](microsoft/knowledge/style/case-action-on-line-after-possibility.md): In an AL case statement, the action for each label is written on the line that follows the label, not on the same line. (microsoft) - [`EntityName` is singular; `EntitySetName` is plural](microsoft/knowledge/style/api-page-entity-naming-singular-plural.md): EntityName and EntitySetName on an API page are the two halves of the OData naming contract. (microsoft) - [`GenerateCaptions` supplies captions for objects that declare none](microsoft/knowledge/style/generatecaptions-supplies-missing-object-captions.md): The GenerateCaptions compiler feature in app.json generates a caption from the object name for pages, tables, reports, XMLports, and request pages that have no Caption or CaptionML of their own, and writes those captions to the XLIFF file so they can be translated. (microsoft) - [`ML` properties and `TextConst` are not exported to the XLIFF file](microsoft/knowledge/style/ml-properties-and-textconst-are-not-exported-to-xliff.md): The generated XLIFF file contains the strings of Caption, ToolTip, and the other label properties, of Label variables, and of report labels. (microsoft) - [A `var` parameter must be called with a variable, never a literal or expression](microsoft/knowledge/style/var-parameters-require-an-addressable-variable.md): When a procedure declares a parameter with var, that parameter is passed by reference: the callee writes back into the caller's own memory location. (microsoft) - [A fixed set of named choices must use Enum, not a raw Integer](microsoft/knowledge/style/fixed-choice-set-must-use-enum-not-integer.md): When a variable or field represents a fixed set of named, mutually exclusive states — a difficulty level, a document type, a processing status — it should be typed as Enum (or Option when extending an object that still uses the legacy type). (microsoft) - [A new procedure that changes the page's current record should take it as `var Record`](microsoft/knowledge/style/mutating-procedure-for-a-page-caller-takes-var-record.md): AL passes parameters by value unless they are declared var, and a by-value Record parameter is a copy: changes the procedure makes "affect only the copy, not the variable itself" (Working with AL methods). (microsoft) - [A page or view name must describe the table it shows](microsoft/knowledge/style/page-name-must-match-source-table.md): A page (or filtered page View) whose name references one entity but whose SourceTable is a different entity misleads every consumer of the object's metadata. (microsoft) - [Add XML documentation to public procedures on library/API codeunits](microsoft/knowledge/style/xmldoc-for-public-library-procedures.md): XML documentation comments (/// …, /// …, /// …) are expected on procedures that form the public surface of a library — codeunits intended to be called from outside the current app: System App modules, AppSource library codeunits, Access =… (microsoft) - [API pages use camelCase, alphanumeric-only values for API properties](microsoft/knowledge/style/api-page-camelcase-properties.md): API pages — pages declared with PageType = API — surface as OData/JSON endpoints. (microsoft) - [Binary yes/no choices must be typed as Boolean, not Option or Integer](microsoft/knowledge/style/binary-choice-must-be-boolean.md): When a field or variable represents a genuine true/false state — yes/no, on/off, active/inactive, blocked/not blocked — it should be typed Boolean. (microsoft) - [Build links into the current environment's client with GetUrl, not a hand-written URL](microsoft/knowledge/style/build-client-links-with-geturl.md): This applies only to links that open a page, report, or record in the environment the code runs in. (microsoft) - [Call objects by name, not by numeric ID](microsoft/knowledge/style/named-invocations-not-object-ids.md): Page.RunModal, Report.Run, Codeunit.Run, and the Page::, Report::, Codeunit::, Table::, XmlPort:: selectors accept either a numeric ID or a named alias. (microsoft) - [Comments must not restate what the code already shows](microsoft/knowledge/style/al-comments-must-not-restate-what-code-already-shows.md): A comment above nearly every statement that just narrates what the statement already says (// Validate the customer number above SalesHeader.Validate("Sell-to Customer No.", CustomerNo)) adds noise without adding information. (microsoft) - [Document each Label placeholder with the Comment parameter](microsoft/knowledge/style/label-comment-explains-placeholders.md): Label and TextConst strings that contain placeholders (%1, %2, …) need a Comment parameter that names what each placeholder is. (microsoft) - [Incremental build and RAD publishing ignore translations](microsoft/knowledge/style/translations-are-ignored-by-incremental-build-and-rad.md): Two development-time publishing modes leave translations out even when "features": \[ "TranslationFile" \] is set in app.json and the per-language XLIFF files are correct. (microsoft) - [Insert the product name with `ProductName`, not as literal text in a message](microsoft/knowledge/style/use-productname-instead-of-hardcoded-product-name.md): Messages, confirmations and errors sometimes name the product ("Welcome to Business Central", "This feature requires Dynamics 365 Business Central"). (microsoft) - [Intrinsic AL function calls use modern casing, not legacy ALL-CAPS](microsoft/knowledge/style/intrinsic-al-functions-must-use-modern-casing.md): AL is case-insensitive, so MESSAGE(...), ERROR(...), CONFIRM(...), and STRSUBSTNO(...) compile and run identically to Message(...), Error(...), Confirm(...), and StrSubstNo(...). (microsoft) - [Keep business logic out of page objects](microsoft/knowledge/style/pages-must-not-contain-business-logic.md): A page procedure that persists a business mutation directly (Rec.Modify() outside the standard record-bound save, or a cross-entry-point business rule implemented only in a page trigger) is an architecture violation even when it compiles: the rule only applies when a user opens that specific page,… (microsoft) - [Keep object names within the 30-character platform limit](microsoft/knowledge/style/object-name-30-char-limit.md): Business Central object names — for tables, pages, codeunits, reports, queries, XML ports, enums, and permission sets — are limited to 30 characters in total. (microsoft) - [Name AL source files `..al`](microsoft/knowledge/style/file-name-object-type-pattern.md): Each AL source file holds a single object, and the file name is expected to be of the form ..al — CustomerCard.Page.al, PostSalesInvoice.Codeunit.al, NoSeriesTests.Codeunit.al, SalesHeader.TableExt.al. (microsoft) - [Omit `else` when the `then` branch ends with `exit`, `break`, `skip`, `quit`, or `error`](microsoft/knowledge/style/no-else-after-terminating-statement.md): When the then branch of an if ends in a terminating statement — exit, break, skip, quit, or error — the else branch becomes the natural fall-through. (microsoft) - [Organize AL source by business feature, not object type](microsoft/knowledge/style/source-organized-by-feature-not-object-type.md): Folder structure inside an AL app has no effect on compilation or runtime behavior — this is a repository-organization convention, not a platform requirement, and different projects reasonably choose differently. (microsoft) - [Page fields can inherit their source table field's `Caption`](microsoft/knowledge/style/caption-required-on-page-fields.md): A page field bound to a table field inherits the source field's Caption unless the page overrides it. (microsoft) - [Page fields need an explicit or inherited `ToolTip` (CodeCop AA0218)](microsoft/knowledge/style/tooltip-required-on-page-fields.md): User-facing page fields need tooltip text, but it does not have to be declared on each page control. (microsoft) - [Parse DateFormula constants with language-independent input](microsoft/knowledge/style/dateformula-evaluate-needs-language-independent-literals.md): A DateFormula stores a formula in a language-independent representation, but Evaluate must first interpret its text input. (microsoft) - [Pass date operands to SetFilter as replacement values, not as text in the filter string](microsoft/knowledge/style/setfilter-date-operands-must-be-replacement-values.md): The String argument of SetFilter is parsed at run time as a filter expression. (microsoft) - [Pass parameters directly to `Error()`, do not wrap with `StrSubstNo`](microsoft/knowledge/style/error-passes-parameters-directly-not-strsubstno.md): Error() accepts a format string and a variable number of arguments — Error(SomeLabelErr, Arg1, Arg2). (microsoft) - [Prefix temporary record variables with `Temp`](microsoft/knowledge/style/temporary-variable-temp-prefix.md): A Record variable declared with the temporary modifier behaves nothing like a normal record variable: it never touches the database, holds rows only for the lifetime of the variable, and is not visible to filters or queries on the underlying table. (microsoft) - [Procedure-local Labels are valid](microsoft/knowledge/style/labels-declared-at-object-scope.md): The AL language supports Label variables at both object and procedure scope. (microsoft) - [Renaming an object or member changes its translation IDs](microsoft/knowledge/style/renaming-objects-or-members-changes-translation-ids.md): Each in an XLIFF file has an id that identifies the object or object member that defines the text. (microsoft) - [Resolve a namespace from the referenced object's source or symbols, never by guessing](microsoft/knowledge/style/namespace-must-be-verified-from-source.md): Since Business Central 2024 release wave 1, Microsoft's own objects are organized under a deep Microsoft.* namespace tree that has been renamed and restructured repeatedly. (microsoft) - [Set `DelayedInsert = true` on API pages](microsoft/knowledge/style/api-page-delayedinsert-true.md): On a normal page, DelayedInsert = false is the default: the record is inserted into the table as soon as the user enters the first field, and subsequent fields are written via Modify triggers. (microsoft) - [Set `Locked = true` on Labels that must not be translated](microsoft/knowledge/style/label-locked-for-non-translatable.md): A Label is by default surfaced to translators and rewritten per locale. (microsoft) - [The generated XLIFF file is rewritten on every build](microsoft/knowledge/style/generated-xliff-file-is-overwritten-on-build.md): With "features": \[ "TranslationFile" \] in app.json, each build writes a .xlf file into the Translations folder that contains every label, label property, and report label of the extension as elements. (microsoft) - [Translate another extension with its own translation IDs](microsoft/knowledge/style/translate-another-extension-with-its-original-trans-unit-ids.md): An extension can ship translations for a different extension, for example a language app that translates the Base Application. (microsoft) - [Use `AboutTitle` and `AboutText` to surface teaching tips on top-level pages](microsoft/knowledge/style/abouttitle-abouttext-teaching-tips.md): The AboutTitle and AboutText properties on a page render a teaching tip — an onboarding callout that appears the first time a user opens the page. (microsoft) - [Use FieldCaption/TableCaption (not FieldName/TableName) in user-facing text](microsoft/knowledge/style/fieldcaption-not-fieldname-in-user-messages.md): FieldName and TableName return the developer-facing identifier of a field or table — a fixed English string used in metadata and in code. (microsoft) - [Write AL Build Artifacts to an Intentional Output Location](microsoft/knowledge/style/al-build-output-must-not-pollute-project-root.md): An AL project's compiled .app file can be written to the project root by default, and current tooling explicitly supports choosing a different destination instead — ALTool's --outfolder option and the al_build agent tool's outputPath parameter both exist for this. (microsoft) - [Write AL Identifiers in English Only](microsoft/knowledge/style/al-identifiers-english.md): All AL identifiers — variables, procedures, parameters, fields, object names, enum values, and label identifiers — must be written in English, regardless of the developer's native language. (microsoft) ## data-modeling - [`Round` direction symbols follow magnitude, not mathematical ordering](microsoft/knowledge/data-modeling/round-direction-symbols-use-magnitude.md): AL's Round(Number, Precision, Direction) uses '>' to round away from zero and '<' to round toward zero. (microsoft) - [`ValidateTableRelation = false` suppresses rename propagation, not just input validation](microsoft/knowledge/data-modeling/validate-table-relation-false-suppresses-rename-propagation.md): Renaming a record updates it in all other locations that reference it through a TableRelation, with no code. (microsoft) - [`xRec` is a before-image in `OnRename` and `OnDelete`, but mirrors `Rec` in `OnInsert` and `OnModify` from code](microsoft/knowledge/data-modeling/xrec-is-a-before-image-only-in-some-triggers.md): xRec is widely believed to be "the previous record" inside every table trigger, and — in reaction to that — is often dismissed with the folk rule *"xRec only works from a page, never from code"*. (microsoft) - [A document's own Print/Email actions call Report Selections directly; Document Sending Profile is scoped to Post-and-Send](microsoft/knowledge/data-modeling/document-print-and-email-actions-call-report-selections-directly.md): table 60 "Document Sending Profile" is not a general gateway for every print/email path — it exists specifically for the combined Post and Send action: "You can set each customer up with a preferred method of sending sales documents, so that you do not have to select a sending option every time… (microsoft) - [A master table's `No.` primary key comes from a number series in `OnInsert`](microsoft/knowledge/data-modeling/master-table-no-from-number-series-in-oninsert.md): In Business Central, a master table (Customer, Vendor, Item, and any custom equivalent) uses a single primary-key field named No. (microsoft) - [A new price source needs both a calculation candidate and a recalculation trigger](microsoft/knowledge/data-modeling/new-price-source-must-add-candidate-and-trigger-recalculation.md): Making a custom field usable as a price source on a sales line is two separate, independent pieces of wiring, and doing only one produces a line that looks like it's using the new source without ever actually being priced by it. (microsoft) - [A setup table is a singleton: one blank-keyed row, no insert or delete](microsoft/knowledge/data-modeling/setup-table-is-a-singleton.md): An application-area setup table (Sales & Receivables Setup, Inventory Setup, and any custom * Setup) holds exactly one record per company. (microsoft) - [A table that owns dependent records must delete them in `OnDelete`](microsoft/knowledge/data-modeling/owning-table-must-delete-dependents-in-ondelete.md): TableRelation looks like referential integrity but only performs lookup and input validation. (microsoft) - [A TableRelation field's length must match the related field](microsoft/knowledge/data-modeling/tablerelation-field-length-must-match-related-field.md): TableRelation points a field at another table, or at a specific field of it with Table.Field. (microsoft) - [Activate a new Price Calculation Handler through OnFindSupportedSetup, not just by implementing it](microsoft/knowledge/data-modeling/activate-new-price-calculation-handler-via-onfindsupportedsetup.md): enum 7011 "Price Calculation Handler" (implements "Price Calculation") is how a new pricing engine plugs into Business Central — extend the enum with a value pointing at a codeunit that implements the Price Calculation interface. (microsoft) - [After Ship-and-Invoice posting, Item Ledger Entry carries the shipment document number](microsoft/knowledge/data-modeling/item-ledger-entry-document-no-follows-last-shipping-no.md): Posting a sales order with both Ship and Invoice in one call creates the Item Ledger Entry during the shipment leg of that combined post, so the entry's Document No. (microsoft) - [An insert-only transfer routine may rely on cleanup its caller already performed](microsoft/knowledge/data-modeling/insert-only-transfer-may-rely-on-caller-cleanup.md): A routine that copies rows from a template table into a target table — a TransferX procedure filling comment, dimension, or attribute lines from a standard-task or template record — is frequently written as filter-and-insert with no DeleteAll of its own. (microsoft) - [Application code must not change the WorkDate](microsoft/knowledge/data-modeling/code-must-not-change-workdate.md): The work date is a per-user session setting the user controls from the client (the date shown in the top-right corner, used to default posting dates and date filters). (microsoft) - [Assign numbers with codeunit `"No. Series"`, not the obsolete `NoSeriesManagement`](microsoft/knowledge/data-modeling/use-no-series-codeunit-not-noseriesmanagement.md): Since 2023 release wave 1 (v22) the number-series API is codeunit 310 "No. (microsoft) - [Business state must have a domain owner](microsoft/knowledge/data-modeling/business-state-must-have-a-domain-owner.md): Business Central's normal successful finalization removes a non-recurring Job Queue Entry. (microsoft) - [Calculate a BLOB field before reading its stream](microsoft/knowledge/data-modeling/calcfields-blob-before-reading-its-stream.md): Get, Find, FindSet, and Next do not load the content of Blob fields. (microsoft) - [Code that calculates a unit price rounds it to the currency's Unit-Amount Rounding Precision](microsoft/knowledge/data-modeling/round-calculated-unit-prices-to-unit-amount-precision.md): Business Central rounds a unit price only where its own code computes one, above all in the standard price calculation. (microsoft) - [Create master records with `Insert(true)` unless the caller does the trigger's work itself](microsoft/knowledge/data-modeling/master-data-must-be-inserted-with-trigger.md): Record.Insert() does not run OnInsert: RunTrigger defaults to false. (microsoft) - [Custom document dispatch must not bypass Report Selections](microsoft/knowledge/data-modeling/custom-document-dispatch-must-not-bypass-report-selections.md): A codeunit that hardcodes which report to run (Report.RunModal(MyReportId, ...)), or builds its own email directly, instead of registering the document through table 77 "Report Selections" and calling its own Print/Email procedures, works for the one case it was written for — and loses everything… (microsoft) - [Delete master and reference data with `Delete(true)` so the owning table's `OnDelete` decides](microsoft/knowledge/data-modeling/delete-master-data-with-trigger.md): Record.Delete() and Record.DeleteAll() do not run OnDelete unless RunTrigger is true; the default is false. (microsoft) - [Design TableRelation branches for additive top-down extension](microsoft/knowledge/data-modeling/table-relation-extensions-are-additive-and-top-down.md): A tableextension can add to an existing TableRelation, but the combined relation is evaluated top-down after the original value. (microsoft) - [Do not use SkipFieldsNotMatchingType to hide required TransferFields mismatches](microsoft/knowledge/data-modeling/transferfields-skip-type-mismatch-can-drop-data.md): Record.TransferFields copies values between fields with matching field numbers. (microsoft) - [Enforce `Blocked` where the master is used, not in the master itself](microsoft/knowledge/data-modeling/check-blocked-in-referencing-code-not-in-master.md): The Blocked field on a master record (Item, Customer, Resource, or a custom master) is inert data. (microsoft) - [Extend Find Entries (Navigate) for new document or transaction tables](microsoft/knowledge/data-modeling/extend-find-entries-navigate-for-new-document-types.md): page 344 Navigate (caption "Find entries") lets a user enter a document number and posting date and see, across every document and ledger entry table BC knows about, how many matching records exist — then drill into any of those rows. (microsoft) - [Extend Price Source Type and its matching document subset enum together, with the same ID](microsoft/knowledge/data-modeling/extend-price-source-type-must-sync-document-subset-enum.md): enum 7003 "Price Source Type" (implements "Price Source", "Price Source Group") is the base list of who a price can apply to — Customer, Vendor, Customer Price Group, Campaign, and so on. (microsoft) - [Generate report barcodes through the Barcode module, with the production font name](microsoft/knowledge/data-modeling/report-barcodes-must-use-barcode-module-and-production-font-name.md): Business Central's barcode support lives in the System Application's Barcode module (src/System Application/App/Barcode): interface "Barcode Font Provider" / "Barcode Font Provider 2D", enum "Barcode Symbology" / "Barcode Symbology 2D", and built-in implementations (codeunit 9215/9221). (microsoft) - [Initialize document defaults in `InitRecord` after assigning the number](microsoft/knowledge/data-modeling/initialize-document-defaults-in-initrecord.md): Business Central document headers assign their number series first and then call an InitRecord procedure that owns the remaining business defaults, such as posting and document dates. (microsoft) - [Mirrored TransferFields cascade fields must match type and length exactly](microsoft/knowledge/data-modeling/transferfields-mirrored-fields-must-match-type-and-length.md): Most custom fields genuinely belong to only one table — a status used only before posting, a note relevant only afterwards, whatever the case may be. (microsoft) - [Never Change a Published Table's Primary or Clustered Key Field List](microsoft/knowledge/data-modeling/do-not-change-primary-key.md): Once a table has shipped — to AppSource, or to any customer environment that has already upgraded onto it — its primary key, and any other key marked Clustered = true, is frozen. (microsoft) - [Pictures must be stored in a Media/MediaSet field, not BLOB](microsoft/knowledge/data-modeling/pictures-must-use-media-not-blob.md): BLOB is still a valid AL field type for arbitrary binary data, but it is not the right choice for storing pictures or images. (microsoft) - [Refresh `Last Date Modified` in both `OnModify` and `OnRename`](microsoft/knowledge/data-modeling/set-last-date-modified-in-onmodify-and-onrename.md): Master tables carry a non-editable Last Date Modified field of type Date. (microsoft) - [Register a new document type through Report Selections, and wire it into Document Layouts correctly](microsoft/knowledge/data-modeling/extend-report-selection-usage-for-new-document-types.md): A custom document that needs printing/emailing should be registered through table 77 "Report Selections". (microsoft) - [Sales, purchase, and service line prices follow the header's Prices Including VAT](microsoft/knowledge/data-modeling/document-line-prices-follow-prices-including-vat.md): Line prices are gross or net depending on the header's Prices Including VAT. (microsoft) - [Share MediaSet items with Insert instead of field assignment](microsoft/knowledge/data-modeling/share-mediaset-items-with-insert-not-field-assignment.md): Media and MediaSet fields store IDs that reference tenant media system tables. (microsoft) - [Split posting routines into Check Line / Post Line / Post Batch](microsoft/knowledge/data-modeling/check-post-line-batch-pattern.md): Business Central's own journal-based posting routines consistently follow a three-codeunit split, each with one primary responsibility — Codeunit "Gen. (microsoft) - [Tables must match one of Business Central's nine table-type conventions](microsoft/knowledge/data-modeling/table-design-must-match-bc-table-type-conventions.md): Business Central's Base Application follows nine recurring table types — Master, Supplemental, Subsidiary, Ledger, Register, Journal, Document, Document History, and Setup. (microsoft) - [TestField a Setup-Table Value Before Using It in a Correctness-Critical Branch](microsoft/knowledge/data-modeling/testfield-required-setup-field.md): A procedure that reads a field from a setup or configuration table inside a branch where the surrounding logic has already decided that value is required needs to guard against it being blank. (microsoft) - [Wire dimension support through DimensionManagement, not ad hoc fields](microsoft/knowledge/data-modeling/dimension-management-wiring.md): Adding dimension support to a custom table is not just a matter of adding a Code\[20\] field, and master tables and document/transactional tables wire into Codeunit "Dimension Management" through two different models — treating them as one mechanism is itself the mistake this article corrects: (microsoft) ## security - [`MaskType` conceals a value in the UI only](microsoft/knowledge/security/masktype-conceals-in-the-ui-only.md): MaskType = Concealed on a table field or page field makes the client display the value masked, with a hide/show icon that lets the user reveal it. (microsoft) - [A secret belongs in IsolatedStorage, never in a table field](microsoft/knowledge/security/secrets-isolated-storage.md): API keys, OAuth tokens, client secrets, and connection strings must not be stored in an ordinary table Text field — not even on a hidden setup table. (microsoft) - [Access Internal is API hygiene, not an authorization boundary](microsoft/knowledge/security/internal-access-is-not-a-security-boundary.md): Access = Internal controls compile-time symbol visibility. (microsoft) - [AL has no built-in HtmlEncode — encode HTML output by hand or avoid it](microsoft/knowledge/security/al-has-no-built-in-htmlencode.md): AL does not ship a built-in HtmlEncode (or equivalent) function. (microsoft) - [Avoid wildcard grants in permission sets](microsoft/knowledge/security/permission-set-avoid-wildcard-grants.md): A permissionset object can grant access object-by-object or with the * wildcard. (microsoft) - [Compose permission sets with IncludedPermissionSets](microsoft/knowledge/security/compose-permission-sets-with-included-sets.md): The IncludedPermissionSets property lets one AL permission set reference another, composing rights out of smaller building blocks. (microsoft) - [Do not concatenate external text into a SetFilter expression](microsoft/knowledge/security/do-not-concatenate-external-text-into-setfilter.md): The String argument of SetFilter is a filter expression, not a value. (microsoft) - [Do not expose security guards as `var` parameters on IntegrationEvent](microsoft/knowledge/security/integrationevent-var-parameter-bypasses-security-guards.md): A var parameter on an \[IntegrationEvent\] is a mutable hook: any subscriber can overwrite the value and the publisher will see the new value when control returns. (microsoft) - [Do not grant rights beyond a user's entitlement](microsoft/knowledge/security/do-not-grant-rights-beyond-a-users-entitlement.md): Entitlements are license-level caps on what a user can access, derived automatically from the BC license tier. (microsoft) - [Do not pass credentials or secrets through IntegrationEvent parameters](microsoft/knowledge/security/integrationevent-must-not-expose-secrets.md): \[IntegrationEvent\] publishes a hook that any extension can subscribe to. (microsoft) - [Every exposed object must belong to a permission set](microsoft/knowledge/security/exposed-objects-must-be-in-a-permission-set.md): An object that is reachable from outside the app's own UI is only usable if it is also granted execute access through a permission set. (microsoft) - [Filters that restrict what a page shows must not be set in filter group 0](microsoft/knowledge/security/page-scope-filters-must-not-be-in-filtergroup-zero.md): Filter group 0 is the standard group: it holds the filters the user sees and edits in the filter pane. (microsoft) - [Grant the minimum InherentPermissions a procedure needs](microsoft/knowledge/security/inherent-permissions-minimal-grant.md): \[InherentPermissions(PermissionObjectType::..., ...)\] and \[InherentEntitlements(Entitlement::...)\] are method-level attributes that let a procedure perform an operation on the listed object even when the caller's permission set does not allow it. (microsoft) - [Guard bulk operations with IsTemporary](microsoft/knowledge/security/guard-bulk-operations-with-istemporary.md): An AL helper that accepts a var Rec: Record X parameter and performs a bulk operation (DeleteAll, ModifyAll, or an unfiltered loop that mutates every record) cannot tell from the signature alone whether the caller passed a temporary buffer or the real table. (microsoft) - [Handle free-form input when ValidateTableRelation is false](microsoft/knowledge/security/validatetablerelation-false-on-user-input.md): ValidateTableRelation = false intentionally lets a user keep free-form input even when it does not match TableRelation. (microsoft) - [On-premises only: protect unavoidable SecretText.Unwrap calls](microsoft/knowledge/security/nondebuggable-required-when-unwrapping-secrettext.md): SecretText.Unwrap() is supported only for Business Central on-premises and exists for compatibility. (microsoft) - [Pick the right IsolatedStorage DataScope for the secret's lifetime](microsoft/knowledge/security/isolatedstorage-datascope-module-vs-company.md): IsolatedStorage read and write methods take a DataScope parameter that decides which slice of storage the value belongs to. (microsoft) - [Prefer IsolatedStorage.SetEncrypted over Set for sensitive values](microsoft/knowledge/security/isolatedstorage-setencrypted-for-sensitive-values.md): IsolatedStorage exposes two write entry points: Set stores the value as-is, and SetEncrypted stores it encrypted at rest. (microsoft) - [Prefer OAuth2 over API keys for external HTTP calls](microsoft/knowledge/security/prefer-oauth2-over-api-keys-for-external-http-calls.md): External HTTP integrations from AL can authenticate using OAuth 2.0 (client-credentials for service-to-service, authorization-code for user-delegated), API keys, basic authentication, or credentials in URLs. (microsoft) - [Procedures that read or write IsolatedStorage must not be public](microsoft/knowledge/security/isolatedstorage-access-must-be-local-or-internal.md): IsolatedStorage partitions its data by extension: values written by one extension are unreadable to another. (microsoft) - [Procedures that RecordRef.Open a caller-provided table must not be public](microsoft/knowledge/security/recordref-open-with-caller-table-must-not-be-public.md): When a codeunit holds permission to system tables — directly, via a permission set granted at install, or via \[InherentPermissions\] — and exposes a public procedure that accepts a table number (or a RecordId, from which the table number is derived) and calls RecordRef.Open on it, the procedure… (microsoft) - [Protect sensitive data in temporary tables](microsoft/knowledge/security/protect-sensitive-data-in-temporary-tables.md): A temporary record copies data out of the source table into session memory. (microsoft) - [Restore the filter group after setting hidden filters, and do not reuse platform groups](microsoft/knowledge/security/restore-the-filtergroup-after-setting-hidden-filters.md): FilterGroup(N) changes the current group for every later SetRange/SetFilter on that record variable until it is changed again. (microsoft) - [Set secret request URIs on HttpRequestMessage](microsoft/knowledge/security/secrettext-with-httpclient.md): The secret URI API belongs to HttpRequestMessage, not HttpClient. (microsoft) - [Storing GetLastErrorText() in table fields is a privacy finding, not a security finding](microsoft/knowledge/security/getlasterrortext-storage-is-privacy-not-security.md): It is tempting to flag any code that calls GetLastErrorText() and writes the result into a table field (or displays it to end users) as a security issue, on the assumption that the error text might leak credentials or system internals. (microsoft) - [Use \[CommitBehavior\] to protect an atomic operation from third-party commits](microsoft/knowledge/security/commitbehavior-attribute-scopes-explicit-commits.md): \[CommitBehavior(CommitBehavior::Ignore)\] and \[CommitBehavior(CommitBehavior::Error)\] are method-level attributes that restrict what an explicit Commit() does inside the annotated method's scope: Ignore silently discards the call; Error raises a runtime error. (microsoft) - [Use indirect permissions when access must be code-mediated](microsoft/knowledge/security/indirect-permissions-for-elevated-access.md): In a permissionset, uppercase letters (R, I, M, D) grant direct permissions: the assignee can read, insert, modify, or delete the table data through any UI or API surface. (microsoft) - [Use SecretStrSubstNo to compose strings that contain secrets](microsoft/knowledge/security/secretstrsubstno-for-composing-secrets.md): SecretStrSubstNo is the secret-preserving counterpart of StrSubstNo. (microsoft) - [Use SecretText for credentials, API keys, and tokens](microsoft/knowledge/security/secrettext-for-credentials.md): SecretText is the AL data type for values that should never appear in a debugger session, in a log, or in a variable watch. (microsoft) - [Validate responses from unauthenticated endpoints before trusting them](microsoft/knowledge/security/validate-unauthenticated-response-before-use.md): When AL calls an external endpoint that does not authenticate *itself* to the client, the response is fully attacker-influenceable — cleartext MITM, a spoofed or compromised host, DNS/redirect games, or simply a misbehaving public service. (microsoft) - [Validate URLs that come from table fields before calling them](microsoft/knowledge/security/validate-user-configurable-urls.md): A URL stored in a table field is user-configurable: anyone with write access to the row can change it. (microsoft) ## upgrade - [`DataTransfer` does not fire validation triggers or event subscribers](microsoft/knowledge/upgrade/datatransfer-skips-triggers-and-subscribers.md): DataTransfer writes sets directly at the database layer, so row-based triggers and events do not run. (microsoft) - [`InitValue` does not back-fill existing rows](microsoft/knowledge/upgrade/initvalue-does-not-update-existing-rows.md): InitValue on a field defines the value the platform assigns when a *new* record is inserted. (microsoft) - [`ModuleInfo.AppVersion` changes meaning with execution context](microsoft/knowledge/upgrade/appversion-meaning-depends-on-execution-context.md): ModuleInfo.AppVersion() is the installed version during normal operation, the version being installed inside install code, and the target version inside upgrade code. (microsoft) - [`OnUpgradePerCompany` / `OnUpgradePerDatabase` should call helpers, not inline logic](microsoft/knowledge/upgrade/triggers-call-helpers-not-implementations.md): The OnUpgradePerCompany and OnUpgradePerDatabase triggers on an upgrade codeunit are dispatch points, not implementation slots. (microsoft) - [Add new enum values only at the end](microsoft/knowledge/upgrade/enum-values-additive-at-end.md): An AL enum is a fixed list of ordinal-named values. (microsoft) - [Control upgrade execution with upgrade tags, not version checks](microsoft/knowledge/upgrade/use-upgrade-tags-not-version-checks.md): Each piece of upgrade logic must run exactly once per company (or database) across the lifetime of an extension. (microsoft) - [Detect first install with `DataVersion() = Version.Create('0.0.0.0')`](microsoft/knowledge/upgrade/first-install-dataversion-zero-check.md): On the first install of an extension on a tenant the platform records a zero data version: AppInfo.DataVersion() returns Version.Create('0.0.0.0'). (microsoft) - [Give every obsolete element a reason and tag](microsoft/knowledge/upgrade/obsoletion-requires-reason-and-tag.md): AL has two obsoletion mechanisms, depending on the symbol: (microsoft) - [Guard every database read in upgrade code with `if`](microsoft/knowledge/upgrade/guard-database-reads.md): Inside an upgrade codeunit (or any procedure transitively invoked from OnUpgradePerCompany / OnUpgradePerDatabase), an unguarded Record.Get, Record.FindSet, or Record.FindLast raises a runtime error when the row or set is missing. (microsoft) - [Hybrid migration codeunits are not standard upgrade codeunits](microsoft/knowledge/upgrade/hybrid-migration-codeunits-not-standard-upgrade.md): Codeunits like HybridBC14, HybridSL, HybridGP, and HybridBaseDeployment implement one-time migration paths from a specific source system into Business Central. (microsoft) - [Install code does not run during a version upgrade](microsoft/knowledge/upgrade/install-code-does-not-run-on-version-upgrade.md): An install codeunit runs when an extension is installed for the first time or an uninstalled version is installed again. (microsoft) - [Keep upgrade validation checks bounded](microsoft/knowledge/upgrade/minimize-onvalidate-upgrade-triggers.md): Triggers such as OnValidateUpgradePerCompany run on every upgrade pass. (microsoft) - [Log telemetry; do not raise errors that block the upgrade](microsoft/knowledge/upgrade/do-not-block-upgrade-on-data-errors.md): When upgrade code encounters unexpected data — a record it expected to find, a relationship it assumed to be intact — the response is to log telemetry and continue, not to raise an error. (microsoft) - [Never nest upgrade tag checks or blend two migrations under one tag](microsoft/knowledge/upgrade/upgrade-tag-logic-must-not-nest-deeply.md): Upgrade tag *checks* should stay flat: never nest one tag's existence check inside another tag's guarded body, and never let one tagged procedure quietly perform a second, functionally distinct migration — that turns two upgrade steps into one that can't be tracked, skipped, or fixed… (microsoft) - [No external calls inside upgrade codeunits](microsoft/knowledge/upgrade/no-external-calls-in-upgrade.md): Upgrade code runs in a constrained execution window: the tenant is mid-upgrade, no users are signed in, and a failure aborts the entire transaction. (microsoft) - [ObsoleteReason need not restate the removal version; ObsoleteTag carries it](microsoft/knowledge/upgrade/obsoletereason-need-not-restate-removal-version.md): An obsoleted object, field, key, enum, or enum value carries both ObsoleteReason and ObsoleteTag, and the two properties have different jobs. (microsoft) - [Prefer `DataTransfer` for set-based upgrade field updates](microsoft/knowledge/upgrade/datatransfer-for-bulk-init.md): DataTransfer performs supported field initialization and field-to-field copies using set-based SQL instead of per-record AL writes. (microsoft) - [Primary-key and field-type changes are safe only on tables without existing data](microsoft/knowledge/upgrade/breaking-changes-only-on-tables-without-data.md): Primary-key changes and field-type changes (for example widening Integer to BigInteger) rewrite the on-disk layout of every row in the table. (microsoft) - [Register upgrade tags that must be seeded for new companies](microsoft/knowledge/upgrade/register-upgrade-tags-with-subscribers.md): SetUpgradeTag(Tag) directly records a completed per-company upgrade step; HasUpgradeTag(Tag) can then guard that step on later upgrades. (microsoft) - [Separate install or upgrade codeunits have no execution order](microsoft/knowledge/upgrade/install-and-upgrade-codeunits-have-no-order.md): An extension can contain multiple Install or Upgrade codeunits, but Business Central does not guarantee the order in which codeunits of the same subtype execute. (microsoft) - [Skip non-essential runtime work when `GetExecutionContext() = ExecutionContext::Upgrade`](microsoft/knowledge/upgrade/skip-nonessential-work-via-execution-context.md): Runtime procedures (table triggers, install routines, helpers called from many places) sometimes fire during the upgrade window because the upgrade itself touches the data they react to. (microsoft) - [Stage obsoletion `Pending → Removed`; write upgrade code on removal](microsoft/knowledge/upgrade/obsolete-pending-to-removed-staging.md): ObsoleteState has a deliberate two-step lifecycle. (microsoft) - [The `version` of a dependency in `app.json` is a minimum](microsoft/knowledge/upgrade/dependency-version-is-a-minimum.md): Each entry in the dependencies list of app.json names another extension by id, name, publisher, and version. (microsoft) - [Unreleased schema changes need no upgrade or migration path](microsoft/knowledge/upgrade/unreleased-schema-change-needs-no-upgrade-path.md): Upgrade and migration findings protect data and schema that have already shipped to customers. (microsoft) - [Upgrade check triggers do not migrate data](microsoft/knowledge/upgrade/check-only-triggers-do-not-migrate-data.md): OnCheckPreconditionsPerCompany/PerDatabase run before the upgrade to verify that it can start. (microsoft) - [Upgrade code must not use ChangeCompany](microsoft/knowledge/upgrade/no-changecompany-in-upgrade.md): The platform upgrades each company in its own context: OnUpgradePerCompany (like the other PerCompany upgrade and install triggers) runs once per company, in a separate system session opened for that company, while PerDatabase triggers run in a session that opens no company. (microsoft) - [Upgrade logic must live in a codeunit with `Subtype = Upgrade`](microsoft/knowledge/upgrade/upgrade-codeunit-subtype.md): A codeunit only participates in the upgrade pipeline when it sets Subtype = Upgrade. (microsoft) ## events - [Adding a parameter to an event is not a breaking change](microsoft/knowledge/events/adding-a-parameter-to-an-event-is-not-a-breaking-change.md): Adding a parameter to an existing event publisher does not break existing subscribers. (microsoft) - [An isolated event's rollback does not undo var parameters or other in-memory state](microsoft/knowledge/events/isolated-event-rollback-does-not-undo-var-parameters.md): When a subscriber to an isolated event fails, the platform rolls back only the Insert, Modify, and Delete calls it made on normal tables. (microsoft) - [Avoid loosely typed event parameters](microsoft/knowledge/events/avoid-loosely-typed-event-parameters.md): Passing RecordRef or xRec as event parameters weakens the contract. (microsoft) - [ChangeCompany leaves triggers and trigger-event subscribers running in the calling company](microsoft/knowledge/events/changecompany-runs-triggers-in-the-calling-company.md): ChangeCompany redirects the data access of one record variable to another company's table. (microsoft) - [Choose static vs manual subscribers deliberately and bind manual ones with BindSubscription](microsoft/knowledge/events/choose-static-vs-manual-subscribers-deliberately.md): An \[EventSubscriber\] codeunit is static by default (EventSubscriberInstance = StaticAutomatic): it is always bound, so it fires for every raise of the event in every session. (microsoft) - [Database trigger setup flags may only be set to true](microsoft/knowledge/events/database-trigger-setup-flags-may-only-be-set-to-true.md): The OnDatabaseInsert, OnDatabaseModify, OnDatabaseDelete, and OnDatabaseRename events let one subscriber react to writes on any table, receiving the record as a RecordRef. (microsoft) - [Declare event publishers local or internal](microsoft/knowledge/events/declare-event-publishers-local-or-internal.md): The access modifier on an \[IntegrationEvent\] or \[BusinessEvent\] publisher controls who may *raise* the procedure, not who may *subscribe* to it. (microsoft) - [Do not add IsHandled to an existing event](microsoft/knowledge/events/do-not-add-ishandled-to-an-existing-event.md): Adding a var IsHandled: Boolean parameter to an event that already shipped without one silently changes the event's purpose — from a plain notification into an overridable seam. (microsoft) - [Do not bypass critical operations with IsHandled](microsoft/knowledge/events/do-not-bypass-critical-operations-with-ishandled.md): The IsHandled override pattern lets a subscriber skip the guarded code entirely. (microsoft) - [Do not change shipped event attribute flags](microsoft/knowledge/events/do-not-change-shipped-event-attribute-flags.md): IncludeSender and, on Integration events, GlobalVarAccess have been event-contract flags since runtime 1.0. (microsoft) - [Do not publish events inside loops](microsoft/knowledge/events/do-not-publish-events-inside-loops.md): Raising an event on every iteration of a loop multiplies the cost of every subscriber by the number of records. (microsoft) - [Do not raise integration events inside a TryFunction whose result the caller consumes](microsoft/knowledge/events/avoid-raising-events-inside-try-functions.md): A TryFunction whose caller consumes its Boolean result catches all errors raised during its execution — including errors thrown by event subscribers. (microsoft) - [Event parameter additions depend on publisher access, not position](microsoft/knowledge/events/add-new-event-parameters-at-the-end.md): Event subscribers bind publisher parameters by name and can omit parameters they do not use. (microsoft) - [Expose process context through a manually bound flag, not a single-instance boolean](microsoft/knowledge/events/expose-process-context-via-manually-bound-flag.md): When an extension drives a process over shared code — a base application report, a posting routine — other extensions hooked into that code cannot tell whether a run belongs to that process: AL keeps no ambient "current process", so the driving app has to publish the context itself. (microsoft) - [Isolated events are isolated only when no write transaction is open](microsoft/knowledge/events/isolated-events-are-isolated-only-outside-a-write-transaction.md): Setting Isolated = true on a BusinessEvent, IntegrationEvent, or InternalEvent (runtime 9.0 / BC20 and later) runs each subscriber in its own transaction: a failing subscriber is rolled back and the next subscriber, then the caller, continue. (microsoft) - [Name event parameters without abbreviations](microsoft/knowledge/events/name-event-parameters-without-abbreviations.md): Event parameter names are part of the public contract a subscriber codes against, so they must be self-explanatory. (microsoft) - [Name events by publisher position](microsoft/knowledge/events/name-events-by-publisher-position.md): An event name should tell a subscriber where in the publisher the event fires. (microsoft) - [Prefer reusing or extending existing events](microsoft/knowledge/events/prefer-reusing-or-extending-existing-events.md): Before adding a publisher, check whether an event already fires at that point in the code. (microsoft) - [Prefer this over IncludeSender in new codeunit events](microsoft/knowledge/events/prefer-this-over-includesender-in-codeunit-events.md): When designing a new publisher, setting IncludeSender to true on \[IntegrationEvent\] or \[BusinessEvent\] gives subscribers the publishing object as an implicit sender parameter. (microsoft) - [Prefix temporary record event parameters with Temp](microsoft/knowledge/events/prefix-temporary-record-event-parameters-with-temp.md): When a record passed to an event is a temporary record — an in-memory buffer not persisted to the database — its parameter name must start with Temp. (microsoft) - [Preserve OnAfter execution when IsHandled skips the body](microsoft/knowledge/events/preserve-onafter-execution-when-ishandled-skips-the-body.md): A routine that exposes both an OnBefore… event (with var IsHandled) and a paired OnAfter… event has a subtle trap. (microsoft) - [Publish thin OnBefore/OnAfter integration events to expose extension points](microsoft/knowledge/events/publish-thin-onbefore-onafter-integration-events.md): A key operation — a posting, release, or validation routine — becomes a hard wall for partners when it ships no integration events: the only way to change it is to overwrite or duplicate the base code. (microsoft) - [Reset IsHandled before publishing only when its value can carry over](microsoft/knowledge/events/reset-ishandled-only-when-the-value-can-carry-over.md): A routine that raises an OnBefore… integration event with a var IsHandled: Boolean parameter passes that variable by reference, so a pre-existing true can affect the following control flow. (microsoft) - [Treat local and internal events as subscriber contracts](microsoft/knowledge/events/treat-local-and-internal-events-as-subscriber-contracts.md): The local and internal access modifiers on Business and Integration event publishers restrict who can raise the procedure; they do not prevent dependent extensions from subscribing. (microsoft) - [Use the IsHandled pattern to make base behaviour overridable](microsoft/knowledge/events/use-ishandled-to-make-base-behaviour-overridable.md): AL has no method overriding, so a procedure that runs its body unconditionally cannot be replaced by an extension without editing base code. (microsoft) ## testing - [Build fixtures with the test Library codeunits, not hand-rolled Init/Insert](microsoft/knowledge/testing/use-library-codeunits-for-test-fixtures.md): BC ships a layer of test Library codeunits — LibrarySales, LibraryPurchase, LibraryERM, LibraryInventory, LibraryRandom and many more — whose job is to create valid records. (microsoft) - [Commit shared fixture data created inside a lazy Initialize(), or later tests lose it](microsoft/knowledge/testing/commit-shared-test-fixture-inside-lazy-initialize.md): A test method with no \[TransactionModel(...)\] attribute defaults to AutoCommit (see transactionmodel-attribute-governs-test-transactions.md): a method that completes without error commits automatically at its own boundary, with no explicit Commit() needed. (microsoft) - [Compare posted-table license failures with the same-environment baseline](microsoft/knowledge/testing/triage-posted-table-license-failures-against-baseline.md): A test fixture that directly inserts into a posted or ledger table can fail with Your license does not grant you the following permissions on TableData : Insert when that environment's license allows only indirect insertion through an authorized object. (microsoft) - [Configure TestIsolation on the test runner](microsoft/knowledge/testing/testisolation-belongs-on-the-test-runner.md): TestIsolation is a property of a Subtype = TestRunner codeunit, not of the test codeunit being executed. (microsoft) - [Cover the full precondition chain in GIVEN, not just the primary record](microsoft/knowledge/testing/given-blocks-must-cover-full-precondition-chain.md): A \[GIVEN\] block is only correct if it sets up every precondition the code under test actually reads, not just the record the scenario is "about." For most master-data tests, creating the primary record is enough. (microsoft) - [Exclude a known-valid TableRelation exception via OnAfterRemoveTableRelation](microsoft/knowledge/testing/table-relation-test-exclude-known-invalid-relations-via-event.md): Codeunit 134926 "Table Relation Test" (shipped in BCApps' test app — only consumers that depend on the BC test libraries can subscribe to it) reads Table Relations Metadata tenant-wide across every installed app, not just the current one, and validates each field's type and length against what its… (microsoft) - [Generate Test Data Programmatically, Never Assume Existing Records](microsoft/knowledge/testing/test-data-must-be-random-and-complete.md): A BC test company normally contains initialized system/setup data — an AL test suite should not assume an empty database, but it must be independent of unrelated business records: create the records and setup it owns rather than looking up a specific code, number, or name assumed to already exist,… (microsoft) - [Generate unique test fixture values with LibraryUtility helpers, not hardcoded literals](microsoft/knowledge/testing/use-generateguid-for-unique-test-fixture-values.md): A fixture helper that assigns a hardcoded literal to a primary-key field, or to any field the test relies on as a unique lookup identifier, collides the moment two tests, or two runs of the same test, create that fixture without cleanup — and a literal longer than the field allows raises a… (microsoft) - [Include app-specific scenarios in a PerformanceTest app's BCPT suite](microsoft/knowledge/testing/bcpt-scenarios-must-be-app-specific.md): A PerformanceTest app that ships with only the generic Microsoft BCPT samples (creating sales orders, purchase orders, posting item journals) measures Business Central's own baseline performance, not the extension it was built to test. (microsoft) - [Keep exactly one WHEN per test, with narrow exceptions for flow and defect-then-fix tests](microsoft/knowledge/testing/test-one-when-per-test.md): This is a testing-design practice, not a BC platform requirement — no AL API enforces it, and it should not gate a change the way a platform-contradicted claim would. (microsoft) - [Match TransactionModel to the commit behavior of the code under test](microsoft/knowledge/testing/transactionmodel-attribute-governs-test-transactions.md): \[TransactionModel(...)\] declares how a test method interacts with the database's write transaction. (microsoft) - [Permission tests must actually lower the execution context](microsoft/knowledge/testing/permission-tests-must-lower-the-execution-context.md): TestPermissions describes how a test runner should establish the permission context; the enum value does not itself assign the business permission set being tested. (microsoft) - [Pin asserterror to a specific error with ExpectedError and ExpectedErrorCode](microsoft/knowledge/testing/asserterror-needs-expectederror-and-code.md): asserterror passes when the guarded statement raises any error at all. (microsoft) - [RecordRef.Open with Temp = true cannot check the real table](microsoft/knowledge/testing/recordref-open-temp-parameter-defeats-real-table-checks.md): RecordRef.Open(No: Integer \[, Temp: Boolean\] \[, CompanyName: Text\]) always takes a real table number. (microsoft) - [Reset per-test state before the IsInitialized guard](microsoft/knowledge/testing/reset-per-test-state-before-the-isinitialized-guard.md): Standard Business Central test codeunits call a local Initialize procedure at the start of every test method. (microsoft) - [Separate UI-layer and logic-layer tests into different codeunits](microsoft/knowledge/testing/ui-test-codeunit-naming.md): A test codeunit that drives pages through TestPage — opening pages, reading FactBox parts, triggering field OnValidate through the page — is testing a different layer than a codeunit that calls business-logic procedures directly. (microsoft) - [Tag test codeunits with FEATURE, SCENARIO, GIVEN, WHEN, and THEN comments](microsoft/knowledge/testing/test-feature-scenario-tags.md): Test codeunits are easier to trust and to review when they carry a four-level comment structure taken from Behaviour-/Acceptance-Test-Driven Development: \[FEATURE\] once at the top of the codeunit naming the functional area under test, \[SCENARIO\] above each test procedure stating one falsifiable… (microsoft) - [Use Assert.IsFalse to check a boolean result, not asserterror around Assert.IsTrue](microsoft/knowledge/testing/use-assert-isfalse-not-asserterror-for-boolean-checks.md): asserterror exists to assert that a statement raises a runtime error; it is not a general-purpose way to invert a boolean check. (microsoft) - [Verify field editability with TestPage.Editable(), opened in edit mode](microsoft/knowledge/testing/use-testpage-editable-to-verify-field-editability.md): Whether a field can actually be changed is a distinct state from whether it is shown or enabled — Editable() and Enabled() are separate TestField functions. (microsoft) - [Verify field visibility and enabled state with TestPage.Visible()/.Enabled()](microsoft/knowledge/testing/use-testpage-visible-enabled-to-verify-field-ui-state.md): A UI test codeunit does not need to inspect table or page properties indirectly to confirm a field is shown or enabled under given conditions. (microsoft) - [Wire UI handlers and verify meaningful outcomes](microsoft/knowledge/testing/ui-handlers-in-tests.md): A test runs headless, so every UI call on the executed path must be intercepted by a matching handler named in \[HandlerFunctions(...)\]. (microsoft) ## agents - [Agent permissions intersect the assigner's; agents cannot configure users](community/knowledge/agents/agent-permissions-intersect-with-assigner.md): An agent is a user, but it cannot configure users or other agents, and it cannot open sensitive pages such as user cards or permission-set assignment. (community) - [Agent setup pages use ConfigurationDialog and the Agent Setup Part](community/knowledge/agents/agent-setup-page-is-configuration-dialog.md): Instance setup is not a Card or StandardDialog. (community) - [Agent setup tables are keyed by User Security ID](community/knowledge/agents/agent-setup-table-keyed-by-user-security-id.md): Each agent instance is a user. (community) - [AnalyzeAgentTaskMessage: Error stops the task; Warning still requires review](community/knowledge/agents/analyze-message-error-stops-warning-forces-review.md): IAgentTaskExecution.AnalyzeAgentTaskMessage runs on inbound and outbound messages. (community) - [Bind extra agent subscribers only inside an agent session](community/knowledge/agents/bind-agent-subscribers-only-in-agent-session.md): Page-filter tweaks, extra validation, and prompt dialogs for the agent should not run for every user. (community) - [Default agent permission sets must exist in AL and stay least privilege](community/knowledge/agents/get-default-access-controls-least-privilege.md): IAgentFactory.GetDefaultAccessControls fills a temporary Access Control Buffer used when an instance is created. (community) - [Do not create agent instances from install, upgrade, or background sessions](community/knowledge/agents/do-not-create-agents-in-install-upgrade-or-background.md): Agent.Create requires an interactive user session. (community) - [Give the agent a dedicated profile that hides unrelated UI](community/knowledge/agents/agent-profile-narrows-visible-ui.md): The agent only sees what its profile shows. (community) - [Instruction documents use responsibilities, guidelines, then ordered steps](community/knowledge/agents/instruction-structure-is-role-rules-steps.md): The runtime treats instructions as the agent's standing prompt. (community) - [Instructions describe outcomes, not page action or tool names](community/knowledge/agents/instructions-describe-work-not-tool-ids.md): Agent tools are the UI the profile exposes. (community) - [Keep the agent setup page source temporary until Update](community/knowledge/agents/agent-setup-source-table-is-temporary.md): ConfigurationDialog setup is a draft: the user can Cancel without writing. (community) - [Other apps cannot call the toolkit APIs on your agent; publish your own API](community/knowledge/agents/cross-app-agent-calls-need-your-public-api.md): For isolation, Agent, Agent Task Builder, and related toolkit codeunits error when the target instance belongs to another app. (community) - [Reapply resource instructions to existing agent instances on upgrade](community/knowledge/agents/reapply-resource-instructions-on-upgrade.md): Static instructions stored as an app resource are copied onto an instance only when you call SetInstructions. (community) - [Register a Copilot capability for the agent on install](community/knowledge/agents/register-copilot-capability-for-the-agent.md): Each agent type needs a Copilot Capability enum value that the factory links as the feature switch and billing surface. (community) - [Set agent instructions as SecretText on the instance](community/knowledge/agents/set-instructions-as-secrettext.md): Instructions are instance data, not an enum caption. (community) - [ShowCanCreateAgent only hides UI create, not programmatic create](community/knowledge/agents/show-can-create-agent-does-not-block-code-create.md): IAgentFactory.ShowCanCreateAgent controls whether the type appears in the in-client create UI. (community) - [Skip incoming message review only after the caller validated the payload](community/knowledge/agents/skip-incoming-review-only-for-trusted-input.md): Incoming task messages default to requiring user approval before the agent runs. (community) - [The default agent profile must be an AL profile in the app](community/knowledge/agents/get-default-profile-lives-in-the-app.md): IAgentFactory.GetDefaultProfile assigns the Role Center and page customizations the agent UI-navigates. (community) - [Use the toolkit instruction keywords for review, mail, and memory](community/knowledge/agents/use-documented-instruction-keywords.md): The agent runtime looks for specific phrases: ask for assistance, request a review, reply, write an email, memorize, Set field, use lookup, Invoke action. (community) - [Wire all three agent interfaces on the metadata provider](community/knowledge/agents/wire-all-three-agent-interfaces.md): An AL agent type is registered by extending Agent Metadata Provider. (community) ## privacy - [`FeatureTelemetry` `CustomDimensions` follow the same privacy rules as `Session.LogMessage`](microsoft/knowledge/privacy/featuretelemetry-customdimensions-no-pii.md): Codeunit "Feature Telemetry" is the second telemetry surface in AL. (microsoft) - [Check the custom Privacy Notice before external data transfer](microsoft/knowledge/privacy/privacy-notice-consent-for-external-data-transfer.md): Business Central's Codeunit "Privacy Notice" creates notices and records per-integration approval. (microsoft) - [DataClassification is a table-field property, not a page-field property](microsoft/knowledge/privacy/data-classification-is-table-field-property.md): DataClassification is defined on table fields. (microsoft) - [DataClassification is required on table fields containing sensitive data](microsoft/knowledge/privacy/data-classification-required-on-pii-fields.md): DataClassification tells the platform what kind of data a table field stores so that telemetry, GDPR data-subject requests, and the platform's audit surfaces can treat it correctly. (microsoft) - [Displaying fields on a page (or in a UI dialog) is not a privacy concern](microsoft/knowledge/privacy/page-display-is-not-a-privacy-concern.md): Every page in Business Central — Card, List, API, ListPart, request pages — renders data to an authenticated user who has been granted permission to see it. (microsoft) - [Do not embed customer data in the telemetry message text](microsoft/knowledge/privacy/no-pii-in-telemetry-message-string.md): Session.LogMessage's message argument is a plain Text. (microsoft) - [Error dialogs emit Error method trace telemetry](microsoft/knowledge/privacy/error-vs-message-telemetry-logging.md): When Error displays a dialog, Business Central emits the RT0030 Error method trace telemetry signal. (microsoft) - [Every `Session.LogMessage` call must specify `DataClassification`](microsoft/knowledge/privacy/session-logmessage-requires-dataclassification.md): Session.LogMessage writes a record to the telemetry pipeline. (microsoft) - [Extension-owned log tables must be registered as retention-policy allowed tables](microsoft/knowledge/privacy/register-owned-log-tables-for-retention-policies.md): The retention policy engine only ever deletes from tables that appear in its allowed-tables list, and an extension may register only tables it owns — it cannot add a base application table or a table from another extension. (microsoft) - [FeatureTelemetry.LogError emits more than caller custom dimensions](microsoft/knowledge/privacy/featuretelemetry-logerror-implicit-errortext.md): FeatureTelemetry.LogError emits its ErrorText as the telemetry message and adds it as alErrorText. (microsoft) - [FlowFields and FlowFilters are classified `SystemMetadata` automatically](microsoft/knowledge/privacy/flowfield-flowfilter-classification-systemmetadata.md): FlowField and FlowFilter are not stored fields — a FlowField is computed from a CalcFormula at read time and a FlowFilter is a transient filter scoped to the record variable. (microsoft) - [In data migration code, classify the destination — not the migration itself](microsoft/knowledge/privacy/migration-destination-classification.md): Migration codeunits such as HybridSL, HybridGP, and HybridBC exist to copy sensitive data — TINs, Federal IDs, social security numbers, financial records — from a source system into Business Central. (microsoft) - [In-memory variables, dictionaries, lists and temporary tables are not a privacy concern](microsoft/knowledge/privacy/in-memory-data-not-a-privacy-concern.md): AL runs in a managed server environment. (microsoft) - [Pass a Label directly as the first Error argument](microsoft/knowledge/privacy/avoid-strsubstno-prebuild-before-error.md): Error method trace telemetry includes the AL error string only when the first Error argument is a Label or TextConst. (microsoft) - [Register custom integrations with Codeunit Privacy Notice](microsoft/knowledge/privacy/register-integration-in-privacy-notice-registrations.md): The current extension point is Codeunit "Privacy Notice". (microsoft) - [Registering a table does not delete anything — consider shipping a default setup](microsoft/knowledge/privacy/ship-a-default-retention-policy-setup.md): AddAllowedTable only makes a table selectable on the Retention Policies page. (microsoft) - [Resolve every `ToBeClassified` before release](microsoft/knowledge/privacy/resolve-tobeclassified-before-release.md): DataClassification = ToBeClassified is the sentinel value the AL compiler accepts while a developer has not yet decided what a new field actually stores. (microsoft) - [Review each ErrorInfo text surface by its actual exposure](microsoft/knowledge/privacy/errorinfo-telemetry-classification-and-errortype.md): Runtime 3.0 (BC 14) provides ErrorInfo.Message, DataClassification, and ErrorType. (microsoft) - [Table-level DataClassification is inherited by fields](microsoft/knowledge/privacy/table-level-data-classification-cascades.md): A valid table-level DataClassification is the effective default for the Normal fields declared inside that table object when they do not declare their own value, and AppSourceCop AS0016 accepts those fields rather than reporting them as unclassified. (microsoft) - [Treat `GetLastErrorText()` as potential customer content](microsoft/knowledge/privacy/getlasterrortext-customer-content-in-errors.md): Parameterless GetLastErrorText() can contain customer content such as field values, record keys, and file names. (microsoft) ## web-services - [Address API records by SystemId, not by a renamable business key](microsoft/knowledge/web-services/expose-systemid-as-the-api-key.md): Every BC table carries a SystemId — an immutable GUID assigned at insert and never reused. (microsoft) - [An API query is read-only and does not support webhooks](microsoft/knowledge/web-services/api-query-is-read-only-and-has-no-webhooks.md): A custom API can be exposed by a page with PageType = API or by a query with QueryType = API, and the two are not interchangeable. (microsoft) - [Check for JSON null before converting a value](microsoft/knowledge/web-services/check-json-null-before-converting-values.md): An optional property in a JSON payload can be missing or present with the value null, and the two cases behave differently in AL. (microsoft) - [Check HTTP status before consuming the response body](microsoft/knowledge/web-services/check-http-status-before-consuming-response-body.md): A successful AL HttpClient call only confirms that the platform completed the HTTP exchange. (microsoft) - [Declare API routing properties and an explicit stable version](microsoft/knowledge/web-services/set-required-api-page-properties.md): An API page needs APIPublisher, APIGroup, EntityName, EntitySetName, and a backing SourceTable to define its routed entity. (microsoft) - [Describe API objects intended for Business Central MCP tools](microsoft/knowledge/web-services/describe-api-pages-for-mcp-with-abouttext.md): For API pages and API queries exposed through the Business Central online MCP server, the documented tool-description precedence is AboutText, then EntitySetCaption, then a camel-cased EntityName. (microsoft) - [Expose business operations as bound actions, not as writable status flags](microsoft/knowledge/web-services/expose-operations-as-bound-actions.md): An API consumer that needs to *do* something to a record — post it, ship it, release it — should call an explicit operation, not mutate a field and hope a side effect fires. (microsoft) - [Format exchanged values with standard format 9](microsoft/knowledge/web-services/format-exchanged-values-with-standard-format-9.md): Format(Value) uses standard format 0, the display format, and follows the current user's regional settings. (microsoft) - [Give API pages least-privilege write access](microsoft/knowledge/web-services/api-page-least-privilege-write-access.md): A general-purpose API page that exposes many fields should not be widened to allow writes on one additional field. (microsoft) - [Handle HttpClient platform failure before accessing the response](microsoft/knowledge/web-services/handle-httpclient-platform-failure-before-response-access.md): AL HttpClient methods can fail before a usable HTTP response exists because of an invalid request, DNS or network failure, certificate validation, timeout, a disabled extension setting, or the response-size limit. (microsoft) - [Keep Consumer-Provided Key Fields Editable on API Pages](microsoft/knowledge/web-services/api-page-key-fields-must-be-editable-on-insert.md): A field listed in ODataKeyFields cannot have Editable = false when the API page allows inserts and the field's value must be supplied by the caller. (microsoft) - [Link API parts on SystemId and choose the correct multiplicity](microsoft/knowledge/web-services/link-api-parts-on-systemid-and-set-multiplicity.md): Multiplicity is available from runtime 6.3 (Business Central 17.3) and defaults an API page part to a 1:N collection. (microsoft) - [Lock down write operations on read-only API pages](microsoft/knowledge/web-services/disable-write-operations-on-read-only-api-pages.md): An API meant purely for reading — a reporting or lookup endpoint — is not read-only just because nobody intends to write to it. (microsoft) - [Read only committed data from APIs that must not expose in-flight writes](microsoft/knowledge/web-services/expose-only-committed-data-from-api-reads.md): This is about the data-consistency contract of an API endpoint: what a consumer receives when it reads. (microsoft) - [Recalculate Stored Derived Fields Before Exposing Them on API Pages](microsoft/knowledge/web-services/stored-derived-fields-must-not-be-exposed-directly.md): A stored field whose value is derived from other fields inside an OnValidate trigger only updates when that specific trigger fires. (microsoft) - [Set the text encoding when converting exchanged text to or from BLOB bytes](microsoft/knowledge/web-services/set-text-encoding-on-streams-exchanged-externally.md): Blob.CreateInStream and Blob.CreateOutStream take an optional TextEncoding; when it is omitted, the stream uses MSDos (OEM) encoding, whose code page depends on the server's system locale. (microsoft) - [Under OData schema version 2.0 an API enum field is a contract by member name; under 1.0 it is the caption](microsoft/knowledge/web-services/api-enum-values-are-a-contract-by-name-not-ordinal.md): What an API page publishes for an enum field depends on the OData $schemaversion the caller receives, and never on the ordinal. (microsoft) - [Verify webhook eligibility and complete every validationToken handshake](microsoft/knowledge/web-services/webhook-eligibility-and-validationtoken-renewal.md): Business Central can subscribe only to eligible API pages, not every endpoint that can be read through an API. (microsoft) - [Version changed API shapes with a new page object](microsoft/knowledge/web-services/version-apis-by-adding-not-mutating-published-versions.md): Once an API version is published, external clients depend on its exact shape — entity names, fields, keys, and behavior — as a stable contract. (microsoft) ## error-handling - [A bare call to a \[TryFunction\] propagates its error; it is not a swallowed failure](microsoft/knowledge/error-handling/bare-tryfunction-call-propagates-errors.md): A bare call to a \[TryFunction\] procedure propagates errors like any ordinary method call. (microsoft) - [A declined `Confirm` in `OnValidate` must abort or revert, not skip a required side effect](microsoft/knowledge/error-handling/declined-confirm-must-abort-not-partially-apply.md): By the time a field's OnValidate body runs, the field already holds its new value. (microsoft) - [An unchecked Record.Get raises an error when the record is missing; it is not silently ignored](microsoft/knowledge/error-handling/unchecked-get-throws-when-record-not-found.md): Record.Get returns a Boolean, but its behavior when no record is found depends on whether the return value is consumed. (microsoft) - [Choose `TestField` For Conditional Checks And `FieldError` For Already-Failed Validation](microsoft/knowledge/error-handling/fielderror-vs-testfield.md): TestField and FieldError look interchangeable but behave differently, and choosing the wrong one produces either dead code or a check that never fires. (microsoft) - [Collect validation errors with ErrorBehavior::Collect and handle the collected list](microsoft/knowledge/error-handling/collect-validation-errors-with-errorbehavior.md): By default a procedure stops on the first Error, so a user fixing ten bad rows must rerun the operation ten times. (microsoft) - [Consume a TryFunction return value when the caller handles the failure](microsoft/knowledge/error-handling/ignored-tryfunction-return-disables-try-semantics.md): A \[TryFunction\] catches errors only when the caller uses its Boolean return value. (microsoft) - [Log writes that must capture failures must survive transaction rollback](microsoft/knowledge/error-handling/log-writes-must-survive-rollback.md): Inserting a log record inside the same transaction as the operation it logs looks correct until the operation errors: the transaction rolls back and takes the log entry with it. (microsoft) - [Match defensive vs. offensive error handling to the blast radius of being wrong](microsoft/knowledge/error-handling/defensive-vs-offensive-code-must-match-blast-radius.md): Whether code should guard gracefully (defensive) or fail loudly (offensive/fail-fast) is not a matter of habit or a blanket house style — it depends on what happens downstream if the guarded condition is silently defaulted or skipped. (microsoft) - [Page record triggers return true by default; a missing exit(true) does not block the operation](microsoft/knowledge/error-handling/page-boolean-triggers-default-to-true.md): The Boolean page record triggers OnInsertRecord, OnModifyRecord, OnDeleteRecord, and OnQueryClosePage return true by default. (microsoft) - [Prefer ErrorInfo with recommended actions over a plain Error for recoverable failures](microsoft/knowledge/error-handling/prefer-errorinfo-for-actionable-errors.md): A plain Error('text') ends the operation with a dead-end dialog: the user reads the message but the system offers no way forward. (microsoft) - [Rely On FieldError's Auto-Generated Context And Pass Only A Lowercase Predicate](microsoft/knowledge/error-handling/fielderror-default-message-logic.md): Rec.FieldError(FieldNo) does not just print the text you give it. (microsoft) - [Set ErrorInfo.ErrorType to Internal for defects you want in telemetry but not in the user's face](microsoft/knowledge/error-handling/errortype-internal-vs-client-for-diagnostics.md): ErrorInfo.ErrorType controls where an error's message is shown. (microsoft) ## reporting - [A layout added in a report extension is not used until it is selected](microsoft/knowledge/reporting/reportextension-layouts-are-not-selected-automatically.md): A reportextension can add layouts through its rendering section, but deploying the extension does not make any of them the report's layout. (microsoft) - [Choose ReportExtension dataitem triggers by their order around the base trigger](microsoft/knowledge/reporting/reportextension-dataitem-trigger-order-is-explicit.md): ReportExtension dataitem triggers run at defined points around the corresponding base-report trigger. (microsoft) - [Clear a Report variable before an independent RunModal execution](microsoft/knowledge/reporting/clear-report-variable-before-independent-runmodal.md): Report.Run() automatically clears the report variable after execution, but Report.RunModal() does not. (microsoft) - [CurrReport.Break ends the current trigger](microsoft/knowledge/reporting/currreport-break-ends-the-current-trigger.md): CurrReport.Break() inside a report dataitem trigger does more than leave an AL loop. (microsoft) - [CurrReport.Quit rolls back report changes and skips OnPostReport](microsoft/knowledge/reporting/currreport-quit-rolls-back-and-skips-onpostreport.md): CurrReport.Quit() aborts the report without committing database changes made during its execution. (microsoft) - [CurrReport.Skip: separate current-trigger exit from later triggers](microsoft/knowledge/reporting/currreport-skip-current-trigger-and-later-triggers.md): CurrReport.Skip() omits the current record from the report dataset. (microsoft) - [Declare report layouts in the rendering section, not with the legacy layout properties](microsoft/knowledge/reporting/declare-report-layouts-in-the-rendering-section.md): Since runtime 9.0 (BC20), reports declare layouts in a rendering section of named layout entries, each with Type, LayoutFile, Caption, and Summary, and choose the default by name with DefaultRenderingLayout. (microsoft) - [Do not rename or remove columns of a report dataset that has shipped](microsoft/knowledge/reporting/do-not-rename-or-remove-shipped-report-dataset-columns.md): A report's dataset column names are the contract that every layout binds to, including layouts that are not in your source code. (microsoft) - [Report output in a loop needs one client download](microsoft/knowledge/reporting/report-output-in-a-loop-needs-one-client-download.md): The Business Central Web client can deliver only one file per request. (microsoft) - [ReportExtension report triggers run after base report triggers](microsoft/knowledge/reporting/reportextension-report-triggers-run-after-base-triggers.md): OnPreReport and OnPostReport on a ReportExtension run after the corresponding triggers on the base report. (microsoft) - [SetTableView cannot broaden DataItemTableView](microsoft/knowledge/reporting/settableview-cannot-broaden-dataitemtableview.md): Report.SetTableView() applies the supplied record view by narrowing the view already defined by the report dataitem's DataItemTableView. (microsoft) - [Stop when RunRequestPage returns empty parameters](microsoft/knowledge/reporting/stop-when-runrequestpage-returns-empty-parameters.md): Report.RunRequestPage() returns an empty string when the user chooses Cancel. (microsoft) ## appsource - [AppSource permission sets must cover setup and usage without SUPER](microsoft/knowledge/appsource/permission-sets-cover-setup-and-usage-without-super.md): An AppSource app must provide permission sets that let assigned users complete the app's setup and normal usage without SUPER. (microsoft) - [Define profiles as AL objects](community/knowledge/appsource/define-profiles-as-al-objects.md): Profiles delivered by a Marketplace extension must be declared as AL profile objects. (community) - [Do not hard-code time-zone offsets](community/knowledge/appsource/do-not-hard-code-time-zone-offsets.md): Marketplace extensions run for users and services in many time zones. (community) - [Keep the Copilot help URL to two path levels](microsoft/knowledge/appsource/keep-copilot-help-url-to-two-path-levels.md): The help URL declared in app.json is what Copilot uses to ground answers about your app. (microsoft) - [Keep web-service paths free of UI calls](community/knowledge/appsource/keep-web-service-paths-free-of-ui-calls.md): Pages and codeunits exposed as web services run without an interactive client. (community) - [Place page extension actions with addfirst or addlast](community/knowledge/appsource/place-page-extension-actions-with-addfirst-or-addlast.md): Place new page-extension actions at the beginning or end of an existing action group with addfirst or addlast. (community) - [Set UsageCategory on searchable entry points](community/knowledge/appsource/set-usagecategory-on-searchable-entry-points.md): Pages and reports that users are expected to open directly must set UsageCategory. (community) - [The File data type's direct I/O methods are OnPrem-only](microsoft/knowledge/appsource/file-datatype-saas.md): The classic File variable type — Open/Create/Read/Write/Close against a path on the local or server filesystem — is scoped OnPrem-only. (microsoft) - [Update the app version at every release](microsoft/knowledge/appsource/release-must-update-app-version.md): At every release — a branch merged to main, a tagged release build, or an AppSource submission — the app's version is consciously updated, not left to the pipeline alone. (microsoft) - [Use invariant date literals](community/knowledge/appsource/use-invariant-date-literals.md): Write fixed dates in AL with the invariant yyyymmddD syntax. (community) ## scm - [Cancel reservations through reservation management](microsoft/knowledge/scm/cancel-reservations-through-reservation-management.md): Persistent "Reservation Entry" rows are not disposable allocation markers. (microsoft) - [Carry out requisition actions through the standard workflow](microsoft/knowledge/scm/carry-out-requisition-actions-through-the-standard-workflow.md): A requisition/planning line is a pending change to a supply/demand network, not just a template for a purchase line. (microsoft) - [Change item applications through posting routines](microsoft/knowledge/scm/change-item-applications-through-posting-routines.md): An "Item Application Entry" connects quantity application to cost flow; changing its inbound entry number is not merely fixing a foreign key. (microsoft) - [Derive base quantities through the line's unit of measure](microsoft/knowledge/scm/derive-base-quantities-through-the-line-unit-of-measure.md): Inventory, item ledger entries, reservations, item tracking, and warehouse quantities are measured in the item's base unit of measure. (microsoft) - [Post calculated revaluation through the item journal batch](microsoft/knowledge/scm/post-revaluation-through-the-item-journal-batch.md): A calculated revaluation line with nonblank "Inventory Value Per" represents an aggregate, not a finalized posting against one item ledger entry. (microsoft) - [Post item ledger changes through item journals](microsoft/knowledge/scm/post-item-ledger-changes-through-item-journals.md): An item ledger entry is not an independently insertable stock balance. (microsoft) - [Post transfers through shipment and receipt codeunits](microsoft/knowledge/scm/post-transfers-through-shipment-and-receipt-codeunits.md): A two-step transfer order preserves a continuous quantity, reservation, and cost/application lineage from the source through in-transit to the destination. (microsoft) - [Reconcile warehouse adjustments with the item ledger](microsoft/knowledge/scm/reconcile-warehouse-adjustments-with-the-item-ledger.md): At a Directed Put-away and Pick location, registering an ordinary warehouse quantity or physical-inventory adjustment and synchronizing it to inventory are distinct steps. (microsoft) - [Transfer item tracking through source reservation codeunits](microsoft/knowledge/scm/transfer-item-tracking-through-source-reservation-codeunits.md): Moving lot/serial tracking between document lines is a source-ownership operation, not a copy of visible tracking fields. (microsoft) - [Use date-aware availability for promising](microsoft/knowledge/scm/use-date-aware-availability-for-promising.md): Item.Inventory is an on-hand quantity, not an available-to-promise answer. (microsoft) ## breaking-changes - [Changing an unreleased symbol is not a breaking change](microsoft/knowledge/breaking-changes/unreleased-symbol-change-is-not-a-breaking-change.md): Breaking-change rules protect contracts that have already shipped to customers or are exposed to external extensions. (microsoft) - [Choose access modifiers deliberately](microsoft/knowledge/breaking-changes/choose-access-modifiers-deliberately.md): Access is a decision about what you are willing to support forever. (microsoft) - [Deprecate public members through the Obsolete lifecycle, never delete them outright](microsoft/knowledge/breaking-changes/deprecate-public-members-with-the-obsolete-lifecycle.md): Deleting or renaming a published procedure (or object) in a single release is a hard break: dependent extensions that reference it stop compiling the moment they pick up the new version, with no warning window to migrate. (microsoft) - [Do not build on code already marked obsolete](microsoft/knowledge/breaking-changes/do-not-modify-code-already-marked-obsolete.md): A member carrying \[Obsolete\], or wrapped in a #if not CLEANxx conditional-compilation block, is already scheduled for deletion — the CLEANxx symbol is flipped on in a future release to strip that code out. (microsoft) - [Do not change the signature of a published procedure](microsoft/knowledge/breaking-changes/do-not-change-published-procedure-signatures.md): A procedure that is reachable from outside its object — any procedure not marked local (and, for on-prem-scoped code, anything a dependent app can still bind to) — is a contract. (microsoft) - [Do not widen access to expose sensitive data through a public API](microsoft/knowledge/breaking-changes/do-not-expose-sensitive-data-through-public-api.md): Every member you make publicly reachable becomes a contract you must keep — and when that member returns a secret, the contract leaks the secret. (microsoft) - [Obsolete published table fields instead of deleting, renaming, or renumbering them](microsoft/knowledge/breaking-changes/obsolete-table-fields-instead-of-deleting-them.md): A shipped table field carries both a source-level contract and persisted data. (microsoft) - [Relocating a field to a tableextension in the same app is not a deletion](microsoft/knowledge/breaking-changes/relocating-a-field-to-a-tableextension-is-not-a-deletion.md): Moving a field out of a base-table definition (or a base-app layer modification of one) into a tableextension that extends the same table, within the same app and keeping the same field ID and name, is a relocation — not a deletion or a rename. (microsoft) - [Send email through the Email module, not Codeunit Mail (397)](microsoft/knowledge/breaking-changes/prefer-email-module.md): Older AL code sends email by calling Codeunit Mail (397). (microsoft) ## finance - [Apply and unapply entries through the application workflow, not status flags](microsoft/knowledge/finance/apply-ledger-entries-through-application-codeunits.md): Customer/vendor settlement is a posting operation involving detailed ledger entries, not just a change to Open on the main entry. (microsoft) - [Change a transaction's dimension set reference, not a shared set's membership](microsoft/knowledge/finance/do-not-edit-shared-dimension-sets.md): The same Dimension Set ID can be referenced by an unposted journal line and by many already-posted entries. (microsoft) - [Change posted customer/vendor due dates through the entry-edit workflow](microsoft/knowledge/finance/change-ledger-due-dates-through-entry-edit.md): A posted customer or vendor due date is supported editable operational data, but it is also represented by Initial Entry Due Date on related detailed ledger entries. (microsoft) - [Copy complete posting dimension sets, not only shortcut projections](microsoft/knowledge/finance/write-dimensions-as-dimension-set-entries.md): When a journal line or posting document inherits dimensions, its Dimension Set ID identifies the complete combination of Dimension Set Entry rows. (microsoft) - [Correct posted financial content through posting workflows, not row surgery](microsoft/knowledge/finance/do-not-modify-or-delete-posted-ledger-entries.md): Changing a posted entry's original amount, account, posting date, or tax amounts in place does not correct the related ledger, register, or source document. (microsoft) - [Create financial ledger entries through the owning posting engine](microsoft/knowledge/finance/post-ledger-entries-through-posting-codeunits.md): Standard financial ledger entries are outputs of posting, not independent rows an extension manufactures. (microsoft) - [Pass the transaction number, not a ledger-entry number, to ReverseTransaction](microsoft/knowledge/finance/reverse-transactions-by-transaction-number.md): Reversal Entry.ReverseTransaction expects a transaction number, while ReverseRegister expects a G/L register number. (microsoft) - [Preserve the journal batch's document-balancing policy](microsoft/knowledge/finance/preserve-journal-batch-document-balance.md): A balanced G/L total does not prove that a general-journal batch satisfies its template's document-balancing policy. (microsoft) - [Supply a VAT-inclusive journal Amount for automatic Normal VAT](microsoft/knowledge/finance/normal-vat-journal-amount-includes-vat.md): For a general-journal line using Automatic VAT Entry and Normal VAT, Amount includes VAT. (microsoft) ## telemetry - [Call FeatureTelemetry.LogUsage only after successful use](microsoft/knowledge/telemetry/feature-usage-only-after-success.md): FeatureTelemetry.LogUsage means that a user successfully used the feature. (microsoft) - [Choose TelemetryScope by who must receive the signal](microsoft/knowledge/telemetry/choose-telemetry-scope-by-audience.md): TelemetryScope::ExtensionPublisher sends a custom trace only to the Application Insights resource configured by the extension publisher. (microsoft) - [Emit FeatureTelemetry uptake states in lifecycle order](microsoft/knowledge/telemetry/feature-uptake-transitions-in-order.md): FeatureTelemetry.LogUptake accepts Discovered, Set up, Used, and Undiscovered, but the platform records the forward transition only as Discovered to Set up to Used. (microsoft) - [Match telemetry Verbosity to the signal's actual severity](microsoft/knowledge/telemetry/match-verbosity-to-signal-severity.md): Verbosity becomes the Application Insights severityLevel and participates in on-premises diagnostic trace filtering. (microsoft) - [Register exactly one Telemetry Logger implementation per publisher](microsoft/knowledge/telemetry/register-one-telemetry-logger-per-publisher.md): The Telemetry and Feature Telemetry codeunits reach an extension publisher's telemetry through an implementation of the "Telemetry Logger" interface registered with "Telemetry Loggers".OnRegisterTelemetryLogger. (microsoft) - [Telemetry event IDs must be stable, unique, and non-placeholder](microsoft/knowledge/telemetry/telemetry-event-id-stable-unique.md): The first parameter of Session.LogMessage is the event ID. (microsoft) - [Treat custom dimension keys as a stable telemetry schema](microsoft/knowledge/telemetry/keep-custom-dimension-schema-stable.md): Business Central prefixes AL custom-dimension keys with al in Application Insights, so an AL key named Result becomes alResult. (microsoft) ## interfaces - [Assign a codeunit to an interface variable for injectable, testable dependencies](microsoft/knowledge/interfaces/assign-codeunit-to-interface-for-testability.md): An interface variable can hold any codeunit that implements the interface, assigned directly — no enum is required. (microsoft) - [Extend published interfaces; do not edit them](microsoft/knowledge/interfaces/extend-published-interfaces-dont-edit-them.md): Adding a method to a shipped interface changes the contract every implementing codeunit must satisfy. (microsoft) - [Guard optional interface casts with `is`](microsoft/knowledge/interfaces/guard-interface-casts-with-is.md): From runtime 15.0, AL can type-test an interface or Variant with is and cast it to another interface with as. (microsoft) - [Handle unknown enum ordinals with UnknownValueImplementation](microsoft/knowledge/interfaces/handle-unknown-enum-ordinals-with-unknownvalueimplementation.md): An enum ordinal can remain in persisted data after the enum extension that declared it is uninstalled. (microsoft) - [Prefer an interface with enum-backed implementation over a case statement for variant behaviour](microsoft/knowledge/interfaces/prefer-interface-over-case-branching.md): When behaviour varies by a discrete "type" — a shipping method, a posting strategy, a payment provider — the obvious first draft is a case over an enum with one branch per variant. (microsoft) - [Set DefaultImplementation on an enum so an unmapped value still resolves to an interface](microsoft/knowledge/interfaces/set-defaultimplementation-on-enum.md): An enum that implements an interface maps each declared value to a codeunit through the Implementation property. (microsoft) ## query - [A lower query data item without SqlJoinType is a left outer join](microsoft/knowledge/query/query-dataitems-default-to-left-outer-join.md): When a lower dataitem in a query sets DataItemLink but omits SqlJoinType, the join is LeftOuterJoin. (microsoft) - [DataItemTableFilter cannot be overwritten at runtime](microsoft/knowledge/query/dataitemtablefilter-cannot-be-overwritten-at-runtime.md): DataItemTableFilter defines a static filter on a Query dataitem. (microsoft) - [Every non-aggregated query column is a group key](microsoft/knowledge/query/every-non-aggregated-query-column-is-a-group-key.md): As soon as one query column sets Method to Sum, Count, Average, Min, or Max, the query groups its result by all other columns, including columns of other data items and columns that use a date method (Day, Month, Year). (microsoft) - [Reopening a Query resets its cursor but keeps its filters](microsoft/knowledge/query/reopening-query-resets-cursor-but-keeps-filters.md): Calling Open() on an already open query first closes the current dataset and opens it again. (microsoft) - [Set Query filters before Open](microsoft/knowledge/query/set-query-filters-before-open.md): Query.SetFilter and Query.SetRange automatically close an open query dataset. (microsoft) - [SetFilter and SetRange overwrite Query ColumnFilter](microsoft/knowledge/query/setfilter-overwrites-query-columnfilter.md): ColumnFilter on a Query column or filter row defines a dynamic filter. (microsoft) ## copilot - [Call Azure OpenAI through the System.AI module, not a hand-built HttpClient request](community/knowledge/copilot/call-azure-openai-through-the-ai-module.md): The System Application's AI module (Azure OpenAI, AOAI Chat Messages, AOAI Chat Completion Params, AOAI Operation Response) is the supported way to call Azure OpenAI from AL. (community) - [Check the AOAI Operation Response before using generated output](community/knowledge/copilot/check-aoai-operation-response-before-using-output.md): GenerateChatCompletion, GenerateTextCompletion, and GenerateEmbeddings in codeunit Azure OpenAI report the outcome of the service call in the AOAI Operation Response passed by var; a failed completion does not stop the AL code. (community) - [Keep user input and record text out of the system message](community/knowledge/copilot/keep-user-input-out-of-the-system-message.md): AOAI Chat Messages separates roles: the system message (SetPrimarySystemMessage, AddSystemMessage) holds the metaprompt that defines the model's task, output format, and guard rails; user messages (AddUserMessage) carry what the user typed and the business data to work on. (community) - [Register a Copilot capability on install and on upgrade](community/knowledge/copilot/register-copilot-capability-on-install-and-upgrade.md): Every extension that calls the AI module must register its Copilot Capability enum value with codeunit Copilot Capability; using a capability that the calling extension has not registered raises an error. (community) - [Save PromptDialog proposals only when the user keeps them](community/knowledge/copilot/save-promptdialog-proposals-only-when-the-user-keeps-them.md): A PromptDialog page shows AI-generated content as a proposal. (community) ## xmlport - [A text XMLport uses MS-DOS encoding unless `TextEncoding` is set](microsoft/knowledge/xmlport/xmlport-text-encoding-defaults-to-msdos.md): An XMLport whose Format is VariableText or FixedText reads and writes text in the encoding given by its TextEncoding property, and the default value is MSDOS. (microsoft) - [Pass the filtered record to the XMLport call to limit its data](microsoft/knowledge/xmlport/pass-the-filtered-record-to-limit-xmlport-data.md): Xmlport.Export, Xmlport.Import, and Xmlport.Run accept an optional record argument, and the XMLport uses any filters attached to that record. (microsoft) - [The `Import` argument of `Xmlport.Run` must match the XMLport's `Direction`](microsoft/knowledge/xmlport/xmlport-run-import-argument-must-match-direction.md): Xmlport.Run(Number \[, RequestWindow\] \[, Import\] \[, Record\]) takes an optional Import argument that says whether the XMLport imports or exports, and its default is true. (microsoft) - [The return value of `Xmlport.Import` and `Xmlport.Export` decides who handles a failure](microsoft/knowledge/xmlport/xmlport-import-export-return-value-controls-failure-handling.md): Xmlport.Import and Xmlport.Export have an optional Boolean return value: true when the operation succeeded, otherwise false. (microsoft) ## Review skills - [AL agents review](community/skills/review/al-agents-review.md): Reviews AL source changes against agent guidance from BCQuality. (community) - [AL AppSource review](microsoft/skills/review/al-appsource-review.md): Performs an AL AppSource review against source and app metadata guidance from BCQuality. (microsoft) - [AL breaking changes review](microsoft/skills/review/al-breaking-changes-review.md): Reviews AL source changes against breaking-changes guidance from BCQuality. (microsoft) - [AL code review](microsoft/skills/review/al-code-review.md): Reviews AL source changes by composing the AL review leaf skills, one per knowledge domain. (microsoft) - [AL Copilot review](community/skills/review/al-copilot-review.md): Reviews AL source changes that build Copilot features on the System.AI module against Copilot guidance from BCQuality. (community) - [AL data-modeling review](microsoft/skills/review/al-data-modeling-review.md): Performs an AL data-modeling review against guidance from BCQuality. (microsoft) - [AL development plan guidance](microsoft/skills/development/al-development-plan.md): Produces a read-only BCQuality knowledge bundle for an existing Business Central AL development plan. (microsoft) - [AL error handling review](microsoft/skills/review/al-error-handling-review.md): Reviews AL source changes against error-handling guidance from BCQuality. (microsoft) - [AL events review](microsoft/skills/review/al-events-review.md): Reviews AL source changes against events-and-subscribers guidance from BCQuality. (microsoft) - [AL Finance review](microsoft/skills/review/al-finance-review.md): Reviews financial journal posting, ledger corrections, applications, VAT handling, and posting-linked dimensions against BCQuality Finance guidance. (microsoft) - [AL interfaces review](microsoft/skills/review/al-interfaces-review.md): Reviews AL source changes against interface and enum-with-implementation guidance from BCQuality. (microsoft) - [AL knowledge consultation](microsoft/skills/knowledge/al-knowledge.md): Answer a Business Central development question with cited knowledge, without reviewing source code. (microsoft) - [AL performance review](microsoft/skills/review/al-performance-review.md): Reviews AL source changes against performance guidance from BCQuality. (microsoft) - [AL privacy review](microsoft/skills/review/al-privacy-review.md): Reviews AL source changes against privacy and data-classification guidance from BCQuality. (microsoft) - [AL Query review](microsoft/skills/review/al-query-review.md): Reviews AL Query objects and Query instance usage against BCQuality guidance. (microsoft) - [AL reporting review](microsoft/skills/review/al-reporting-review.md): Reviews AL Report and ReportExtension code against BCQuality reporting guidance. (microsoft) - [AL security review](microsoft/skills/review/al-security-review.md): Reviews AL source changes against security guidance from BCQuality. (microsoft) - [AL style review](microsoft/skills/review/al-style-review.md): Reviews AL source changes against naming, labelling, localization, and code-convention guidance from BCQuality. (microsoft) - [AL Supply Chain Management review](microsoft/skills/review/al-scm-review.md): Reviews SCM inventory costing, item application, reservations, order tracking, item tracking, warehouse, transfer, and planning workflows in AL. (microsoft) - [AL telemetry review](microsoft/skills/review/al-telemetry-review.md): Performs an AL telemetry review against guidance from BCQuality. (microsoft) - [AL testing review](microsoft/skills/review/al-testing-review.md): Performs an AL testing review against guidance from BCQuality. (microsoft) - [AL UI and accessibility review](microsoft/skills/review/al-ui-review.md): Reviews AL page and control add-in UI files, AL code that sends or recalls notifications, and AL code that registers guided experience setup items, against UI text, caption, tooltip, notification, and accessibility guidance from BCQuality. (microsoft) - [AL upgrade review](microsoft/skills/review/al-upgrade-review.md): Reviews AL source changes against upgrade-code and migration guidance from BCQuality. (microsoft) - [AL web services review](microsoft/skills/review/al-web-services-review.md): Reviews AL API surfaces, outbound HTTP integrations, and webhook handlers against web-services guidance from BCQuality. (microsoft) - [AL XMLport review](microsoft/skills/review/al-xmlport-review.md): Reviews AL XMLport objects and XMLport calls against BCQuality guidance. (microsoft)