bcquality/custom/knowledge/architecture/cmfrt-calls-from-base-table-only.md
BeytullahCengiz88 afb1fa2883 Add CMFRT naming conventions, object ID ranges, and patterns documentation
- Introduced guidelines for using the "CMFRT" prefix in object names, fields, and procedures to avoid naming collisions and ensure clarity.
- Established rules for object ID ranges to prevent conflicts with other extensions and maintain historical integrity.
- Documented best practices and anti-patterns for various coding patterns, including case statements, interface injection, label usage, and validation methods.
- Implemented a standards review skill to evaluate AL source changes against CMFRT company standards, ensuring compliance with naming, permissions, and architectural patterns.
2026-07-14 14:09:04 +02:00

1.8 KiB

bc-version domain keywords technologies countries application-area
all
architecture
codeunit
base-table
entry-point
coupling
architecture
cross-codeunit
subscriber
al
w1
all

CMFRT calls to implementation codeunits from base table only

Description

In the CMFRT extension architecture, all calls to implementation codeunits must originate from the base-table object. No AL object other than the base table may call a CMFRT implementation codeunit directly. Event subscriber codeunits handle platform or application events and call the base table's entry-point procedures — not the implementation codeunit directly. Pages and reports call base-table procedures. This keeps the base table as the single integration point for all business-logic calls and ensures that OnBefore/OnAfter integration events fire consistently regardless of where a workflow begins.

Best Practice

When a subscriber codeunit handles an event and needs to trigger a CMFRT operation, it calls the relevant base-table procedure. When a page action initiates business logic, it calls the base-table procedure. The implementation codeunit is an internal detail of the base table and should never appear in using clauses or variable declarations of pages, reports, or subscriber codeunits.

See sample: cmfrt-calls-from-base-table-only.good.al.

Anti Pattern

Calling an implementation codeunit directly from a page, report, subscriber codeunit, or any object other than the base table. Direct calls bypass the base table's integration events, making the operation invisible to dependent extensions that subscribed to those events. This also creates hidden coupling between the caller and the implementation, which breaks when the implementation codeunit is renamed or replaced under the interface.

See sample: cmfrt-calls-from-base-table-only.bad.al.