You can try with the below code but it will show error like below.
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Item-Check Avail.", 'OnBeforeCreateAndSendNotification', '', false, false)]
local procedure OnBeforeCreateAndSendNotification(ItemNo: Code[20]; UnitOfMeasureCode: Code[20]; InventoryQty: Decimal; GrossReq: Decimal; ReservedReq: Decimal; SchedRcpt: Decimal; ReservedRcpt: Decimal; CurrentQuantity: Decimal; CurrentReservedQty: Decimal; TotalQuantity: Decimal; EarliestAvailDate: Date; RecordId: RecordId; LocationCode: Code[10]; ContextInfo: Dictionary of [Text, Text]; var Rollback: Boolean; var IsHandled: Boolean);
var
ItemCheckAvail: Codeunit "Item-Check Avail.";
NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
ItemAvailabilityCheck: Page "Item Availability Check";
AvailabilityCheckNotification: Notification;
NotificationMsg: Label 'The available inventory for item %1 is lower than the entered quantity at this location.', Comment = '%1=Item No.';
DetailsTxt: Label 'Show details';
DontShowAgainTxt: Label 'Don''t show again';
begin
AvailabilityCheckNotification.Id(CreateGuid());
AvailabilityCheckNotification.Message(StrSubstNo(NotificationMsg, ItemNo));
AvailabilityCheckNotification.Scope(NOTIFICATIONSCOPE::LocalScope);
AvailabilityCheckNotification.AddAction(DetailsTxt, CODEUNIT::"Item-Check Avail.", 'ShowNotificationDetails');
AvailabilityCheckNotification.AddAction(DontShowAgainTxt, CODEUNIT::"Item-Check Avail.", 'DeactivateNotification');
ItemAvailabilityCheck.PopulateDataOnNotification(AvailabilityCheckNotification, ItemNo, UnitOfMeasureCode,
InventoryQty, GrossReq, ReservedReq, SchedRcpt, ReservedRcpt, CurrentQuantity, CurrentReservedQty,
TotalQuantity, EarliestAvailDate, LocationCode);
NotificationLifecycleMgt.SendNotificationWithAdditionalContext(
AvailabilityCheckNotification, RecordId, ItemCheckAvail.GetItemAvailabilityNotificationId());
Rollback := true;
IsHandled := true;
end;