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

Notifications

Announcements

No record found.

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?

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    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.

  • rsorima Profile Picture
    5 on at

    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

    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

    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

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

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 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans