Implement maintainable master data patterns
Master data represents reusable business entities that documents and entries reference. Stable identity, useful lookup text, predictable validation, and protected deletion make those references safe over time.
Apply numbering and naming conventions
Store number-series codes in a setup table. In the master table's OnInsert trigger, test the configured series and request the next number from Codeunit "No. Series". In the number field's OnValidate trigger, call TestManual before accepting a user-entered number and clear the stored series code.
Use a short, stable number as the primary key and a separate description or name for display. Don't use a mutable description as a key. Add a DropDown field group so lookups show both values.
Validate state and relationships
A blocked field prevents new transactions without erasing the master record or its history. Apply the blocked filter in table relations, and test the state again in table validation when the business rule must hold for every caller.
List and card pages serve different tasks. The list supports search, filtering, comparison, and navigation. The card supports focused edits and related actions. Set CardPageId on the list and add drill-down actions for open documents and historical entries.
Protect deletion and history
Before you delete a master record, test whether open documents or permanent entries reference it. Reject deletion with a clear error that identifies why the record must remain. Don't cascade-delete transactional or historical records to make master deletion succeed.
If the business permits deletion after all references are removed, keep the deletion check in the table. Page-only checks don't protect API, background, test, or extension code that deletes the record directly.
For more information, see No. Series codeunit, TableRelation property, and CardPageId property.