BC: how to see the code of a codeunit

TMNielsenTMNielsen Member Posts: 3
I'm new to Mibuso, so I'm confused why we put BC discussions in NAV Three Tier, but everyone else does, so I will give it a try :-)

I'm also new to BC developement. I have with VS Code AL created a few test extensions from tutorials, but now I have a real task. I have a process in BC that has looong runtime and it creates database locks. In the Database logs overview I can see that the locks are created by codeunit 1639 and I would like to see the code of this codeunit.

How can I do this?

Best Answers

  • SanderDkSanderDk Member Posts: 497
    Answer ✓
    HI @TMNielsen

    You can also extract the source code from your .alpackages in VSCode by opening any of the app file with a ZIP tool (like WinRAR of 7Zip) and view the AL files there.
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
  • SanderDkSanderDk Member Posts: 497
    Answer ✓
    HI TMNielsen,
    Personally when I need to search throw the AL file I use a tool called GrepWin (https://tools.stefankueng.com/grepWin.html)
    There you can search for "codeunit 1639" and it will show the file with that text :-)
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.

Answers

  • kabrocokabroco Member Posts: 111
    Hello TMNielsen,

    You could install an extension in VSCode: AZ AL Dev Tools. With this tool you get a table with the standard objects. (like in old development environment). The tool has other verry usefull features.

    Option 2: is to unpack some where the source files installed on de installation DVD.

    Good luck.
    Greetings,
    Carolien
  • TMNielsenTMNielsen Member Posts: 3
    Thanks, I will have a look at AZ AL Dev Tools.

    I'm running BC Saas, so installation DVD is not available.
  • SanderDkSanderDk Member Posts: 497
    Answer ✓
    HI @TMNielsen

    You can also extract the source code from your .alpackages in VSCode by opening any of the app file with a ZIP tool (like WinRAR of 7Zip) and view the AL files there.
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
  • bbrownbbrown Member Posts: 3,268
    The base AL code is on the product DVD under the "Applications" folder.
    There are no bugs - only undocumented features.
  • TMNielsenTMNielsen Member Posts: 3
    SanderDk wrote: »
    HI @TMNielsen

    You can also extract the source code from your .alpackages in VSCode by opening any of the app file with a ZIP tool (like WinRAR of 7Zip) and view the AL files there.

    Hi SanderDk

    This looks promising, but the .aplackages contains 4 .app files with a lot of folders with src code. The .al files are named and not numbered, so I can only see the codeunit number if I open the files.

    Do you have a suggestion how I can search the .al source codes in these .app files to find a specific codeunit no. like 1639?
  • SanderDkSanderDk Member Posts: 497
    Answer ✓
    HI TMNielsen,
    Personally when I need to search throw the AL file I use a tool called GrepWin (https://tools.stefankueng.com/grepWin.html)
    There you can search for "codeunit 1639" and it will show the file with that text :-)
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
Sign In or Register to comment.