BCQuality rule · appsourceAL Developmentofficial - Microsoftderived - from the source, no model text

Place page extension actions with addfirst or addlast

Place new page-extension actions at the beginning or end of an existing action group with addfirst or addlast.

Rule on GitHub · community layer · appsource · BC all · tier official · derived

Description

Place new page-extension actions at the beginning or end of an existing action group with addfirst or addlast. Anchoring a new action relative to a specific base-app action with addbefore or addafter couples the extension to an implementation detail that can move or disappear between Business Central releases.

Best Practice

Choose the semantic action area or group and append or prepend the extension’s actions. This keeps placement deterministic without depending on the continued existence of one neighboring action.

See sample: place-page-extension-actions-with-addfirst-or-addlast.good.al.

Anti Pattern

Using addbefore or addafter to place newly added actions next to a specific action from another app. The syntax is valid AL, but the placement anchor is brittle for a Marketplace extension.

See sample: place-page-extension-actions-with-addfirst-or-addlast.bad.al.

Examples

Changed by


From microsoft/BCQuality at a4593a1, MIT License, Copyright (c) 2026 Microsoft Corporation (license).