community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

🔐 Partial Masking in Business Central: Smart Data Protection 👀

Business Central BC27 introduced MaskType for client-side data protection, but the post demonstrates a custom solution that extends this with configurable partial masking patterns (Last Four Digits, First And Last Two, Middle Visible, Full Mask) for any field in any table, allowing users to toggle between masked and full views.

post Gerardo Rentería Blog

Gerardo Renteria · 2025-11-02 · 573 words · about 3 min

"The MaskType property offers two states: None or Concealed. While this provides basic protection, it's an all-or-nothing approach."

Key points

  • BC27’s MaskType property offers only binary protection (None or Concealed), which the author enhances with four customizable masking patterns
  • The solution uses a centralized configuration table to define which fields should be masked and which pattern to apply
  • Page extensions add calculated fields with assist buttons to toggle between partial and complete data display
  • The implementation includes enum patterns, management codeunit, configuration storage, and permission set components

Quotes

  • “The MaskType property offers two states: None or Concealed. While this provides basic protection, it’s an all-or-nothing approach.” (Explains the limitation of the native feature that motivated the custom solution)
  • “Instead of completely hiding or revealing the data, you can choose exactly which portion to display.” (Describes the core benefit of the partial masking approach over binary masking)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

  • enum “GDRGMaskPattern”
  • codeunit “GDRGMaskingManagement”
  • table “GDRGFieldMaskingSetup”
  • page “GDRGFieldMaskingSetup”
  • page “GDRGFieldMaskingLookup”
  • permissionset “GDRGMasking”

Not found in BC28-30: enum “GDRGMaskPattern”, codeunit “GDRGMaskingManagement”, table “GDRGFieldMaskingSetup”, page “GDRGFieldMaskingSetup”, page “GDRGFieldMaskingLookup”, permissionset “GDRGMasking”.

Context

  • Features: partial masking, custom masking patterns, centralized configuration, data protection, toggle between masked and full view, standard field extension
  • Versions: BC27

Source: Gerardo Renteria, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.