Skip to main content

Notifications

Community site session details

Community site session details

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

How to override existing procedure on a table using extension

(0) ShareShare
ReportReport
Posted on by 5

Hello I am a newbie in Dynamics 365, and I am on the struggle on how to edit existing procedure on a table.

For example. In sales header table, a local procedure has been declared.

LOCAL LookupAppliesToDocNo()
GLSetup.GET;
IF ("Document Type" IN ["Document Type"::"Credit Memo","Document Type"::"Return Order"]) AND
GLSetup.GSTEnabled("Document Date")
THEN BEGIN
"BAS Adjustment" := BASManagement.CheckBASPeriod("Document Date",CustLedgEntry."Document Date");
"Adjustment Applies-to" := "Applies-to Doc. No.";
END;

I just wanted to comment some of the code here. How could I achieve it? Is it possible in extension?

  • rsorima Profile Picture
    5 on at
    RE: How to override existing procedure on a table using extension

    Thank you so much. This helps a lot.

    In accessing the base code in wave2, this link may help. https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-publish-code-customization

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: How to override existing procedure on a table using extension

    With Wave 2 release, standard source code is available on the dvd (for the onpremise version) or from the Docker container (if SaaS).

    I think you’re talking to SaaS here, so you can create a docker container with the image you’re using and then extract the base app code from here. Command to do that:

    $alProjectFolder = "C:\SD\BaseApp"
    Create-AlProjectFolderFromBcContainer -containerName $containerName `
    -alProjectFolder $alProjectFolder `
    -useBaseLine -useBaseAppProperties
  • rsorima Profile Picture
    5 on at
    RE: How to override existing procedure on a table using extension

    Thanks for the reply, I highly appreciate it. 

    How about in wave 2 where there is no Development environment meaning we cannot see existing code blocks? Therefore I cannot duplicate the procedure. 

    Is there any other way to do so?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: How to override existing procedure on a table using extension

    Not possible without modifying the base code (so, not possible on a SaaS environment). You cannot modify existing code, but only attaching to events (and here you don't have events exposed). In these cases (if the modification is needed and you cannot do in another way) you need to duplicate the function in your objects.

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

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 999

#2
YUN ZHU Profile Picture

YUN ZHU 934 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 612

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans