Anchors and Placement
Understanding anchors is essential for placing fields in the correct position on pages. This page explains how anchors work and how to use them effectively.
What Are Anchors
An anchor is a reference point on a page that determines where your field appears. When you place a field, you specify:
- Placement Type - How to position relative to the anchor
- Anchor - The reference point itself
Together, these determine the exact location of your field.
Placement Types
AddBefore
Places your field immediately before the anchor.
Use when:
- You want the field to appear above or to the left of an existing field
- You're inserting into a sequence of fields
Example:
- Anchor: "Phone No."
- Result: Your field appears just before "Phone No."
AddAfter
Places your field immediately after the anchor.
Use when:
- You want the field to appear below or to the right of an existing field
- You're appending to a group of related fields
Example:
- Anchor: "Phone No."
- Result: Your field appears just after "Phone No."
AddFirst
Places your field at the beginning of a container.
Use when:
- You want the field to be first in a group
- The anchor is a group, repeater, or section
Valid anchors:
- Groups (named sections on cards)
- Repeaters (list views)
- Cue Groups (on Role Centers)
- Grid containers
Example:
- Anchor: "General" group
- Result: Your field is first in the General group
AddLast
Places your field at the end of a container.
Use when:
- You want the field to be last in a group
- Adding to an existing section without disrupting order
Valid anchors:
- Same as AddFirst (groups, repeaters, etc.)
Example:
- Anchor: "General" group
- Result: Your field is last in the General group
Types of Anchors
Field Anchors
Individual fields on the page.
How to find:
- Open the page in Business Central
- Identify the field you want to place near
- Note the field name for the anchor lookup
Example anchors:
- "No."
- "Name"
- "Posting Date"
- "Amount"
Group Anchors
Named groups or sections on the page.
How to find:
- Look for section headers on card pages
- Common groups: "General", "Invoicing", "Shipping"
Example anchors:
- "General"
- "Invoice Details"
- "Communication"
Repeater Anchors
The list/grid area on list pages.
How to find:
- List pages typically have one main repeater
- Document pages have line repeaters
Part Anchors
FactBoxes and other page parts.
How to find:
- Look at the right side of the page for FactBoxes
- Parts have names like "Customer Statistics FactBox"
Sections cannot be placed in the FactBox area. The FactBox area appears as a selectable anchor when placing a new section, but the placement does not work — fields added to such a section never display. Do not anchor a new section to the FactBox area; it is a known non-functional option. See Page Groups.
Finding the Right Anchor
Method 1: Visual Inspection
- Open the target page in Business Central
- Look at the field you want to place near
- Note the field's caption
- Use that caption in the anchor lookup
Method 2: Anchor Lookup
- In SOD's placement configuration
- Click the Anchor Field dropdown
- Browse available anchors
- Select the appropriate one
Method 3: Page Inspection
- Go to Inspect > Pages
- Open the page customization
- Review the page structure
- Identify anchor candidates
Anchor Selection Guidelines
For Card Pages
| Placement Goal | Recommended Approach |
|---|---|
| Add to existing section | AddAfter on last field in section |
| Insert in middle | AddBefore or AddAfter on adjacent field |
| Start new section | Create Page Group first |
| Add to General | AddLast with "General" group anchor |
For List Pages
| Placement Goal | Recommended Approach |
|---|---|
| Add column | AddAfter on adjacent column |
| First column | AddFirst on repeater |
| Last column | AddLast on repeater |
For Document Pages
| Placement Goal | Recommended Approach |
|---|---|
| Header field | AddAfter on header field anchor |
| Line field | AddAfter on line field anchor |
| Match header/line | Ensure correct page part |
Placement Index
When multiple fields use the same anchor and placement type, the Placement Index determines order.
Example:
- Field A: AddAfter "Phone No.", Index 1
- Field B: AddAfter "Phone No.", Index 2
- Result: Phone No. → Field A → Field B
Managing Index
- SOD typically assigns indices automatically
- Adjust manually if you need specific ordering
- Lower numbers appear first
Common Anchor Patterns
Adding to Customer Card
Goal: Add field after Phone No. in General section
Placement Type: AddAfter
Anchor: Phone No.
Adding to Sales Order Header
Goal: Add field in the General section
Placement Type: AddLast
Anchor: General (group)
Adding Column to Item List
Goal: Add column after Description
Placement Type: AddAfter
Anchor: Description
Adding to Document Lines
Goal: Add field to sales lines
Page: Sales Order Subform (or similar)
Placement Type: AddAfter
Anchor: Quantity (or relevant line field)
Troubleshooting Anchors
"Anchor Not Found" Error
Causes:
- Anchor name is incorrect
- Anchor doesn't exist on target page
- Anchor was renamed or removed
Solutions:
- Verify anchor name spelling
- Check that anchor exists on the page
- Try a different anchor
An invalid anchor surfaces as a compilation error at publish time, naming the anchor field. This applies to calculated fields as well as field placements. To find where the missing anchor is used, select the error and run Get Source Code from selected error.
Refreshing symbols and updating apps will not fix it. The cause is a configuration reference to an anchor that does not exist, not a stale symbol cache. Errors such as <Field> is not a valid anchor on page are covered in Publishing Failures.
Field Not Appearing
Causes:
- Invalid anchor selection
- Placement type incompatible with anchor
- Page structure changed
Solutions:
- Verify anchor is valid for placement type
- Try a different anchor
- Re-download symbols if page structure changed
Field in Wrong Position
Causes:
- Wrong anchor selected
- Wrong placement type
- Conflicting placement index
Solutions:
- Review anchor selection
- Check AddBefore vs AddAfter
- Adjust placement index
AddFirst/AddLast Not Working
Causes:
- Anchor is not a container (group, repeater)
- Anchor is a field instead of group
Solutions:
- Use AddBefore/AddAfter for field anchors
- Find the correct group/container anchor
Avoid "AddFirst" in the "Content" Area
Do not use AddFirst against the "Content" area. "Content" refers to the entire page, and Business Central can become confused by fields added to the top of it — the usual result is that the field does not appear at all after publishing.
Use instead:
- AddLast in the General group, or
- AddAfter relative to an existing field (for example AddAfter Posting Date)
If a field you added does not show up after publishing, an AddFirst/Content placement is a prime suspect. Change it to one of the alternatives above and republish.
Line Field Lands in the Totals Area
Symptom: a field added to a document page appears in the Totals part of the lines rather than as a column in each line.
Cause: the placement type or anchor positions it outside the line columns — no field anchor, or an anchor that resolves to the totals/summary area.
Fix: use AddAfter and select an existing field in the lines as the anchor. The field then appears as a column immediately after that anchor in every line.
The Value Is Not Visible in the List
If a value must be visible in the overview before a record is opened, the field has to be placed on the List page as a column — not on the Card or Document header page, where it only appears once the record is open.
Example: field 44 (Order No.) placed on page 142 (Posted Sales Shipments) appears as a list column.
Lookup Drop-Down Columns Cannot Be Extended
Placement types and anchors apply to fields and columns on pages, not to the columns shown inside a lookup drop-down. Extending a lookup's column list is not currently possible in SOD — see Place Fields on Pages.
Best Practices
Choose Stable Anchors
- Use well-established fields unlikely to change
- "No." and "Name" fields are typically stable
- Avoid anchoring to frequently modified areas
Test After Publishing
- Always verify placement after publishing
- Check on the actual page, not just in SOD
- Test different scenarios (new records, existing records)
Document Your Anchors
- Record which anchors you're using
- Note any special considerations
- Update documentation if anchors change
Consider Page Variants
- Some pages have variants (e.g., Posted Sales Invoice vs Sales Invoice)
- May need separate placements for each
- Verify correct page is targeted