Obsolete Attribute
Version: Available or changed with runtime version 4.0.
Specifies that the annotated symbol will be deprecated.
Applies To
- Method
- DeclareMethod
- Variable
- Event
Syntax
[Obsolete([Reason: Text] [, Tag: Text])]
Arguments
[Optional] Reason
Type: Text
Specifies the reason for the symbol being deprecated.
[Optional] Tag
Type: Text
Specifies a free-form text to support tracking of where and when the object was marked as obsolete, for example, branch, build, or date of obsoleting the object.
Remarks
To mark objects and other elements of code, use the ObsoleteState Property and ObsoleteReason Property.
Example
Setting the attribute on a method or a variable. Each method must be marked with [Obsolete('<Reason>','<tag>')]
.
codeunit 50143 SoonObsolete
{
[Obsolete('Pending removal use X instead', '17.0')]
procedure MyProcedure()
var
myInt: Integer;
begin
// Make something happen
end;
}
See Also
AL Method Reference
Method Attributes
Directives in AL
Best Practices for Deprecation of Code in the Base App
ObsoleteState Property
ObsoleteReason Property
ObsoleteTag Property
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈