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

Community site session details

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

[INFO] How to debug on Business Central cloud version

(1) ShareShare
ReportReport
Posted on by 1,659

How to debug on Business Central cloud version

ALFDebugCloud00.png

Some "disclaimer" at the beginning.

Business Central change/improve every month.

I will provide below the today status for the 'Debug area' (October 2019).

// for example, in November we expect such feature:

https://docs.microsoft.com/en-us/dynamics365-release-plan/2019wave2/dynamics365-business-central/ability-download-database-backup-file

Well … You cannot attach a debugger session to a production environment. You need to create a sandbox by copying the production data and then debug the sandbox environment.

As first step I go to my Business Central Admin Center, I’ve created a sandbox environment with copy of Production data for some specific date.

// By the way today you can have 3 Sandbox and 3 Production Business Central environments in an AAD tenant.

ALFDebugCloud01.png

Open the sandbox environment and create a dummy extension via Designer option.

I am using such way just for fast creation of the AL project (.json files).

ALFDebugCloud02.png

ALFDebugCloud03.png

ALFDebugCloud04.png

ALFDebugCloud05.png

ALFDebugCloud06.png

ALFDebugCloud07.png

For launch.json add:

      "breakOnError": true,

      "sandboxName": "GBSandboxCopy25Oct2019"

ALFDebugCloud08.png

For app.json increase version number:

ALFDebugCloud09.png

AL: Download Symbols

ALFDebugCloud10.png

ALFDebugCloud11.png

Now we need create a let say ‘Debug codeunit’ (extension).

Our ‘Debug codeunit’ (extension) will subscribed to the posting codeunit.

For the today I see that System (Cloud BC) stop on break point that added in extensions only.

ALFDebugCloud12.png

ALFDebugCloud13.png

Now create a line in Item Journal, start Event Recorder, pick right lines with filter

// With Cloud you must use the closest point to hook within an extension to debug.

ALFDebugCloud14.png

ALFDebugCloud15.png

ALFDebugCloud16.png

ALFDebugCloud17.png

ALFDebugCloud18.png

ALFDebugCloud19.png

Copy signature for the subscriber function from Event Recorder:

ALFDebugCloud20.png

ALFDebugCloud21.png

Rename MyProcedure

ALFDebugCloud22.png

Go to Definition, as result we could see Posting code, copy parameters from IntegrationEvent

ALFDebugCloud23.png

ALFDebugCloud24.png

ALFDebugCloud25.png

ALFDebugCloud26.png

Add Breakpoints to the ‘Debug codeunit’ (extension)

ALFDebugCloud27.png

Stop a bit. We are not Publish our extension yet. Let’s do it.

ALFDebugCloud28.png

ALFDebugCloud29.png

Start Debugging:

ALFDebugCloud30.png

ALFDebugCloud31.png

ALFDebugCloud32.png

ALFDebugCloud33.png

P.S.

Useful Links (BC/NAV): https://community.dynamics.com/business/f/dynamics-365-business-central-forum/307965/info-useful-links 

  • Vaakura Muhuka Profile Picture
    15 on at
    RE: [INFO] How to debug on Business Central cloud version

    Hi Alexey Finogenov,

    Thanks for the upload! could you do procedure for OnPrem, I am struggling to to debug my Base App and the container\docker!  

  • Alexey Finogenov Profile Picture
    1,659 on at
    RE: [INFO] How to debug on Business Central cloud version

    For on-prem (docker based or common local installed) I think you should use for debug the new feature "Attach and Debug Next" (15.0),  https://community.dynamics.com/business/f/dynamics-365-business-central-forum/370327/info-how-to-debug-the-standard-code-business-central-15-x-on-prem-with-use-docker-and-without-publish-baseapp

    https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-attach-debug-next#attach-support

  • josalm Profile Picture
    28 on at
    RE: [INFO] How to debug on Business Central cloud version

    In launch.json, the property 'sandboxName' is now deprecated. You should use 'environmentType' and 'environmentName'.

    So in this case it should be like this:

          "environmentType": "Sandbox",

          "environmentName": "GBSandboxCopy25Oct2019"

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,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans