Skip to main content

Notifications

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

Modify a base procedure

Posted on by 20

Greetings to all of you!

Two customers of mine , need to be able to create a new sales quote for a customer whose Blocked Status is All.


The one has BC (cloud version ) and the other has Dynamics NAV ( on-prem).

I noticed that the whole procedure which permit the opening of a new sales document ,when a customer is blocked , is here : 

pastedimage1638356616276v1.png

Ideally, i would like to modify this base procedure and remove the part of DocType = Quote. 
As far as i understand , this can't be possible when BC comes as a SaaS. Due to that , i can;t modify the base code on my customer which runs on cloud. Any other solution?
How about the one who has NAV on prem? Is it possible to modify the base code?


I dont have a lot of experience when it comes to development, so , any help will be greatly appreciated.

Thank you in advance for your time.

  • CU19090633-0 Profile Picture
    CU19090633-0 4 on at
    Modify a base procedure

    To remove or change the part of the procedure related to DocType = Quote, you would subscribe to the appropriate events (such as OnBefore or OnAfter events) in the procedure and modify its behavior in the extension.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Modify a base procedure

    Technically it is possible to change the base application code if you are running BC on-prem but it is not recommended to do so.

    What you should do is to find and integration event to use so you can modify the business logic through that.

    In the case you have you should look at this integration even that is on the sales header table:

    [EventSubscriber(ObjectType::Table, Database::"Sales Header", 'OnValidateBillToCustomerNoOnBeforeCheckBlockedCustOnDocs', '', false, false)]
          local procedure OnValidateBillToCustomerNoOnBeforeCheckBlockedCustOnDocs(var SalesHeader: Record "Sales Header"; var Cust: Record Customer; var IsHandled: Boolean);
          begin
          end;
    Then you can put your own logic in and return IsHandeled like true that will make the base app handling not to be executed.
    Hope this helps you.
  • Suggested answer
    JAngle Profile Picture
    JAngle 33,159 on at
    RE: Modify a base procedure

    The first part of the procedure is your chance to skip the check. That applies to both platform types. Given it is an event subscriber you skip the standard check but write your own. This way you can have your logic but maintain some of the standard aspects

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: Modify a base procedure

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

    Thanks.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans