ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Problem codeunit 10838 "PaymentMgt Subscribers FR" Access = Internal

Open JulienSaibron opened this issue 6 months ago • 4 comments

Why do you need this change?

We need two events for our custom application.

Codeunit::"PaymentMgt Subscribers FR", OnCreateTempCollectionEntriesOnBeforeInsert Codeunit::"PaymentMgt Subscribers FR", OnBeforeCheckPaymentLine

Describe the request

Codeunit::"PaymentMgt Subscribers FR", OnCreateTempCollectionEntriesOnBeforeInsert Codeunit::"PaymentMgt Subscribers FR", OnBeforeCheckPaymentLine

Image Image

this application microsoft is Payment Management FR

Image Internal work item: [AB#636048](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/636048)

JulienSaibron avatar May 12 '26 09:05 JulienSaibron

Hi @JulienSaibron,

Thank you for your extensibility request. To help us process it efficiently, please update the issue to include the required information.

📚 Extensibility Guidelines

Missing Information:

  • Usage scenario and business/technical justification: Explain how OnCreateTempCollectionEntriesOnBeforeInsert and OnBeforeCheckPaymentLine would be used in your extension, what custom logic needs to run there, and what current limitation or duplication this would solve.

Please update the issue with the missing details. We'll automatically re-analyze once updated.

[!NOTE] Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

[!TIP] Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

github-actions[bot] avatar May 12 '26 14:05 github-actions[bot]

Usage scenario

These events are required in the context of SEPA Direct Debit file generation in the French Payment Management module.

Our extension adds specific business logic related to SEPA file content enrichment and payment validation, including custom data fields and a dedicated reconciliation structure between payment lines and customer ledger entries.

How the events are used

  1. OnCreateTempCollectionEntriesOnBeforeInsert

This event is used to enrich the temporary Direct Debit Collection Entry before it is inserted.

We add:

  • A custom SEPA description combining Payment Line No. and a custom description field
  • A custom identifier based on the Payment Header No.

This ensures that all required business-specific information is correctly included in the SEPA file.

  1. OnBeforeCheckPaymentLine

This event is used to fully override the standard validation logic (IsHandled := true) and apply our own business rules.

The custom logic includes:

  • Enforcing that only customer payments are processed
  • Validating that the customer bank account matches the SEPA mandate
  • Ensuring that payment lines are always applied to a document
  • Building a custom mapping between payment lines and customer ledger entries (multiple applies-to entries)

Custom logic

  • Enrichment of SEPA data before insertion
  • Custom validation rules aligned with business constraints
  • Creation of a custom reconciliation structure (Direct Debit Collection Applies)

Current limitation

Currently, these events are not accessible due to the codeunit scope being Internal.

Without these events:

  • It is not possible to inject logic before the temporary collection entry insertion
  • It is not possible to override the validation process cleanly

This forces us to:

  • Duplicate standard code from Payment Management
  • Or implement fragile workarounds

Providing these events would ensure a clean extension model, prevent code duplication, and align with Business Central extensibility principles.

JulienSaibron avatar May 18 '26 09:05 JulienSaibron

✅ Analysis complete - approved for implementation


Implementation:

Remove Access = Internal from Codeunit 10838 "PaymentMgt Subscribers FR" to allow external extensions to subscribe to the existing integration events OnCreateTempCollectionEntriesOnBeforeInsert and OnBeforeCheckPaymentLine.

Current code:

codeunit 10838 "PaymentMgt Subscribers FR"
{
    InherentEntitlements = X;
    InherentPermissions = X;
    Access = Internal;

Proposed change:

codeunit 10838 "PaymentMgt Subscribers FR"
{
    InherentEntitlements = X;
    InherentPermissions = X;

File: PaymentMgtSubscribersFR.Codeunit.al

[!NOTE] Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

[!TIP] Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

AleksandricMarko avatar May 19 '26 13:05 AleksandricMarko

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

AleksandricMarko avatar Aug 12 '26 09:08 AleksandricMarko