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...
Suggested Answer

Debug Business Central RESTful API

(1) ShareShare
ReportReport
Posted on by 42

Having problems attempting to debug BC REST API code units.

There are a lot of web posts (see bottom of post for number of references) but seems to primarily apply to application. 

I have tried various combinations - and at times it seems to be doing something however I tend to lock up my local Docker instance. I think it might be triggering breakpoints when service is called but doesn't fire?

There seems to be an order - first debug (F5) then Ctrl-Shift-F5 (debug without publishing). Does this apply to REST code unit web services as well?

Launch.json:

        {

            "name""Attach Debug Server",
            "type""al",
            "request":  "attach",
            "server""">http://localbc",
            "serverInstance""BC",
            "authentication""UserPassword",
            "breakOnError"true,
            "breakOnRecordWrite"false,
            "enableSqlInformationDebugger"true,
            "enableLongRunningSqlStatements"true,
            "longRunningSqlStatementsThreshold"500,
            "numberOfSqlStatements"10,
            "breakOnNext""WebServiceClient"
        },
I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    on at

    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.

  • Gabor Faludi Profile Picture
    302 on at

    hi ,

    whats your question here ?

    tx

  • Xmeister Profile Picture
    42 on at

    I am trying to debug a BC RESTful Web Service.. so basically add a breakpoint in code and be able to step through it when it is called via a service request via something like Postman.

  • ldiane Profile Picture
    15 on at

    Did you find a solution?

  • Suggested answer
    Arnold Gantuangco Profile Picture
    20 on at

    This BC(19) configuration below works for me with Postman request post using ODATA V4 unbound action and VS AL codeunit debugging.

    Just run VS (F5 - debugging and choose attach configuration). Then when you post request in postman, it will hit the breakpoints in VS AL.

    pastedimage1648778299338v1.png

  • AD-13081151-0 Profile Picture
    27 on at
    I am also having this problem. Cant attach the debug to the codeunit with web requests... 

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 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans