Skip to main content

Notifications

Announcements

No record found.

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

Debugging Base Application (GoToDefinition)

Posted on by 85

Hello Business Central experts,

I am attempting to debug an issue that is occurring with a particular Purchase Order (the purchase order has an error on line 390,000) but that line does not exist. So in order to dig into this issue more I would like to run the debugger as the Test Report Process is running and maybe I will be able to determine the issue.

Now what I have done is created a basic AL project that has a launch.JSON that points to the Sandbox Environment that I want to test, next I used Go-To Definition to access the Purchase Order Page and I set a few breakpoints on Posting and test Report. But the debugger does not fire. I'm not sure if its worth noting but I also tried attaching breakpoints to Codeunit Test Report Print. Additionally I can debug code that I have written in a page extension for example.

I was wondering if there is an issue with my method? Or can I not debug this cloud sandbox? I have attached the text in my Launch file. This is on Platform 14.0 Runtime 3.0 (Spring release)

"type""al",
            "request""launch",
            "name""This is the name of my sandbox",
            "startupObjectId"22,
            "startupObjectType""Page",
            "breakOnRecordWrite"false,
            "breakOnError"true,
            "launchBrowser"true,
            "enableLongRunningSqlStatements"true,
            "enableSqlInformationDebugger"true,
            "sandboxName""Sandbox Name Here",
            "tenant""This is the ID of my Tenant"
 
  • James_French Profile Picture
    James_French 85 on at
    RE: Debugging Base Application (GoToDefinition)

    Hello Alexey, thank you for this. I was able to do the sort of debugging I was looking for with this method.

  • Verified answer
    Alexey Finogenov Profile Picture
    Alexey Finogenov 1,659 on at
    RE: Debugging Base Application (GoToDefinition)

    Regarding debug online BC standard code, I’ve found that we should use a ‘debug extension’ way… find the event that nearest to the problem standard code lines, subscribe to the event..

    https://community.dynamics.com/business/f/dynamics-365-business-central-forum/370681/info-how-to-debug-on-business-central-cloud-version

  • Suggested answer
    Robert B. Profile Picture
    Robert B. 257 on at
    RE: Debugging Base Application (GoToDefinition)

    Here's a good example where you have some visuals on how to attach your debugger.

    Set your flag to break on error, reproduce your problem in your environment and then use the attach to as pictured there.

    Let me know if that works.

    Cheers,

    Robert

    If this helps in resolving your issue, please verify my answer!

  • James_French Profile Picture
    James_French 85 on at
    RE: Debugging Base Application (GoToDefinition)

    Hello Robert, I have followed these steps but it does not break to debugger. The error is thrown when I run the Test Report function in the PO, is this just not possible to do?

  • Suggested answer
    Robert B. Profile Picture
    Robert B. 257 on at
    RE: Debugging Base Application (GoToDefinition)

    Hi James,

       Please try these steps: https://www.kauffmann.nl/2019/04/09/debug-without-publishing/

    Cheers,

    Robert

    If this helps in resolving your issue, please verify my answer!

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans