Controlling Field Visibility on Master Pages Using User Setup in Business Central

Overview

In Microsoft Dynamics 365 Business Central, permissions alone are often insufficient when the requirement is to allow users to work with master data while hiding sensitive financial information such as balances, net changes, or internal values.

Typical examples include:

  • Users posting journals but not seeing G/L balances
  • Users selecting bank accounts without seeing bank balances
  • Users accessing master records but not financial KPIs

This article describes a scalable and maintainable AL pattern that uses User Setup and page extensions to control field visibility at runtime.


Design Principles

This solution is based on the following principles:

  • User-based configuration (not role-based)
  • Centralized logic for visibility rules
  • Reusable procedures
  • SaaS-safe customization
  • Minimal impact on permissions

High-Level Architecture

  1. Extend User Setup with visibility options
  2. Expose those options on the User Setup page
  3. Centralize visibility logic in a codeunit
  4. Use page extensions to hide/show fields dynamically
  5. Optionally hide FactBoxes and totals

Step 1: Extending User Setup

Table Extension

Add one or more Boolean fields to User Setup that represent visibility rules.


This allows fine-grained control per user.

Step 2: User Setup Page Extension

Expose the fields so administrators can maintain them.



Step 3: Central Visibility Management Codeunit

All logic should live in a single codeunit to avoid duplication.


This codeunit can be extended later without touching page logic.

Step 4: Applying Visibility Rules on Master Pages

Example: G/L Account List


Example: G/L Account Card


Step 5: Hiding Balance FactBoxes

Balances are often exposed via FactBoxes, even when fields are hidden.


Step 6: Journals and Documents (Optional)

In journals, totals and balance fields can also be hidden using the same approach.

Example: General Journal


Security Considerations

  • This approach does not secure data at table level

  • Users with sufficient permissions can still access data via APIs or reports

  • Always combine with:

    • Indirect permissions on ledger tables

    • Restricted access to financial reports

This solution is meant for UI-level data exposure control.


Best Practices

  • Keep all visibility logic in one codeunit

  • Use descriptive User Setup fields

  • Default to false when User Setup is missing

  • Document which pages are covered

  • Combine with permission sets


Summary

Using User Setup + AL procedures is a robust way to control what users see on master pages in Business Central. It provides flexibility beyond permission sets and allows you to meet real-world security and usability requirements in SaaS environments.

This pattern is easy to extend, maintain, and standardize across projects.





Comments

Popular posts from this blog

Understanding Database Indexes in Business Central (and How They Can Help You)