web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Obsolete Codeunits

(1) ShareShare
ReportReport
Posted on by 629
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. 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    96,266 Super User 2025 Season 2 on at
    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
    26,687 Super User 2025 Season 2 on at
    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

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,457

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 742 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 669 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans