Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix B: Troubleshooting and FAQs

Objectives

By the end of this appendix you will be able to:

  • Diagnose common AL development failures faster
  • Use a repeatable debug checklist before changing code
  • Classify errors by layer (environment, compile, runtime, data)
  • Apply issue-resolution habits that improve contribution quality

B.1 Debug checklist (use in order)

  1. Environment check: the AL extension for VS Code is installed, symbols are downloaded, and the sandbox is reachable.
  2. Compile check: resolve the first error in the output before chasing the errors that follow from it.
  3. Repro check: reproduce the problem with the fewest steps and known sample data.
  4. Boundary check: inspect each transition from page action to codeunit to table trigger.
  5. Data check: verify key fields and your assumptions about prior state (xRec).
  6. Regression check: add or run tests for the fixed behavior (Chapter 14).

B.2 Common error catalog

Error symptomLikely causeFirst fix step
Table ... not foundMissing symbol reference or wrong object ID/rangeRe-download symbols and verify object metadata
The record already existsDuplicate key on insertValidate key design and duplicate guards
You do not have permission ...Missing permission set grantsReview Chapter 11/15 permission setup
Runtime cannot be changed unexpectedlyTrigger checks current state (Rec) instead of prior state (xRec)Correct trigger logic and add regression test
API call fails with non-success statusRemote endpoint/auth/contract mismatchLog status code and validate request contract

B.3 FAQ

How do I know whether logic belongs in a page trigger or codeunit?

Put reusable business rules in a codeunit and call them from page actions. Keep page code thin (Chapters 8 and 9).

Why does my trigger block valid edits?

Check whether your rule needs the pre-change state (xRec) instead of the current state (Rec) in OnModify.

When should I add tests?

Right after you add or fix business logic, and especially after a bug fix that could regress (Chapter 14).

B.4 Escalation notes for contributors

When you open an issue or PR, include minimal repro steps, the observed and expected behavior, a link to the affected chapter or object, and evidence that you validated the change.

Appendix summary

You now have a practical troubleshooting sequence, and you can quickly map common errors to their likely causes. You can also package technical findings clearly so others can work with them.


Tasks

  1. Checklist run. Apply B.1 to one recent issue you encountered.
  2. Error mapping. Add one new row to the error catalog from your own experience.
  3. Try it yourself. Write a minimal repro template for future chapter bugs.

Check your work: your troubleshooting notes should be detailed enough for another contributor to reproduce and validate your fix.