Identifiers in event subscribers (LC0028)

Event subscriber attribute parameters for object names and procedure names should match the actual identifiers they reference. Using incorrect or outdated identifiers can cause the subscription to silently fail.

This rule validates that the identifiers used in EventSubscriber attributes correctly reference existing objects and procedures.

Example

The following event subscriber has an incorrect object name:

codeunit 50100 MyCodeunit
{
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Incorrect Name", 'OnAfterPost', '', false, false)] // Identifiers in event subscribers [LC0028]
    local procedure OnAfterPost()
    begin
    end;
}

To fix this, use the correct object and procedure names:

codeunit 50100 MyCodeunit
{
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnAfterPostSalesDoc', '', false, false)]
    local procedure OnAfterPost()
    begin
    end;
}