Edit

Compiler Warning AL0924

Note

The AL diagnostics topics are in preview. If you have input for this topic, we'd love to hear from you. Use our GitHub repo to create a PR and add content to this topic by going to here. To read about contributing, see Contribute to the Help. Thanks!

Interface method '{0}.{1}' will become required. {2}Add an implementation now to avoid a future breaking change.

Description

A default interface method is marked with [RequiredPending], indicating it will become mandatory in a future version. Implement it to avoid a breaking change later.

Remarks

When an interface method has a default implementation and is marked with the [RequiredPending] attribute, the interface author is signaling that this method will become required in a future version. The default implementation currently serves as a fallback, but relying on it will result in a compilation error once the method becomes mandatory.

This warning gives implementors a grace period to add their own implementation before the breaking change takes effect.

How to fix it

Add an explicit implementation of the method in your codeunit. This ensures your code continues to compile when the method becomes required.

Example of code that triggers AL0924

Given an interface in a dependency module:

interface IPaymentProvider
{
    procedure ProcessPayment(amount: Decimal);

    [RequiredPending('ProcessRefund will become required in v27.0', '27.0')]
    procedure ProcessRefund(amount: Decimal);
    begin
        // Default: no refund support
        Error('Refunds are not supported.');
    end;
}

The following codeunit triggers AL0924 because it does not implement ProcessRefund:

codeunit 50100 MyPaymentProvider implements IPaymentProvider
{
    procedure ProcessPayment(amount: Decimal);
    begin
        // Payment logic
    end;

    // Warning AL0924: IPaymentProvider.ProcessRefund will become required.
    // The default implementation is used as a fallback for now.
}

Example of how to fix it

Add an explicit implementation of the pending-required method.

codeunit 50100 MyPaymentProvider implements IPaymentProvider
{
    procedure ProcessPayment(amount: Decimal);
    begin
        // Payment logic
    end;

    procedure ProcessRefund(amount: Decimal);
    begin
        // Refund logic - implement before it becomes required
    end;
}

Getting started with AL
Developing extensions
Interfaces in AL
Compiler Error AL0923