Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Obsolete Codeunits

(1) ShareShare
ReportReport
Posted on by 501
Hi I have an entire codeunit that I need to obsolete for a SAAS app. (ID changed for simplicity)
Could anyone confirm if the Obsolete format is correct. We need to put the Obsolete state inside the codeunit and not above it?
After the first release we use the CLEAN25 in the app Json and release again. Only after this will the ID be removed?
 
codeunit 50000 "Eventsubscribers"
{
#if not CLEAN25
    ObsoleteReason = 'Duplicate ID in another app';
    ObsoleteState = Pending;
    ObsoleteTag = 'TEST-381';
#else
    ObsoleteState = Removed;
    ObsoleteTag = 'TEST-381';
#endif
 
    [EventSubscriber(ObjectType::Table, Database::"Sales Header", 'OnAfterCheckSellToCust', '', false, false)]
    local procedure OnAfterCheckSellToCust(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; Customer: Record Customer; CurrentFieldNo: Integer)
    begin
        SalesHeader.Validate("Customer Type", Customer."Customer Type");
    end;
}

Thanks in advance. 
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,813 Super User 2024 Season 2 on at
    Obsolete Codeunits
    There are many standard functions that you can refer to.
     
    In addition, this is a customized function. If there is no extension that depends on it, I think there is no problem in deleting it directly.
     
    Thanks.
    ZHU
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,610 Super User 2024 Season 2 on at
    Obsolete Codeunits
    Hi,
     
    Please refer to this :
     
     
    Best regards,
    Mohamed Amine MAHMOUDI

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,296 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,285 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans