Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

[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 

  • josalm Profile Picture
    josalm 20 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"

  • Alexey Finogenov Profile Picture
    Alexey Finogenov 1,659 on at
  • Vaakura Muhuka Profile Picture
    Vaakura Muhuka 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!  

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,468 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans