How to find all references (or occurrences) of a certain field in the code of an .app

IvanGarciaSuberoIvanGarciaSubero Member Posts: 6
edited 2024-11-01 in NAV Tips & Tricks
I'm working with the .app LS Retail, it's open source (but readonly) so I can click in the .app file in Visual Studio Code and navigate through all its code files (tables, extensions, codeunits...).

Let's say I'm working with a certain field of a table extension, and I need to know how this file is used in the .app, so I'd like to find all references of this field in the code of the whole .app. This task is easily done in other IDEs like Eclipse or Visual Studio or , but I can't find a way to get it with Visual Studio Code.

Here is an example, I need to find all references to the field "LSC Explode BOM in Statement Post", there may be about 10 references or less in the code of the .app. It would also help me if I can't search by text (not through hard code references) if it is possible
33324z6l3fwx.png

Or maybe a way for opening all files of an .app and find text in all opened files? It sounds heavy, but I don't care if the search takes hours to finish, it's better than manually search :(

Thanks

Answers

  • DenSterDenSter Member Posts: 8,307
    The only way I can think of is to extract the objects into a 'dummy' workspace. Don't worry about compiler errors and object file names, that should work for references.

    Also, take a look at the Statical Prism tool for AL, they may have something to make that easier https://stati-cal.com/
  • IvanGarciaSuberoIvanGarciaSubero Member Posts: 6
    @DenSter I'm taking a look to that tool, thanks a lot.

    On the other hand, in a somewhat crude way it is possible to unzip the .package (i.e. with 7-zip), get all code files and then open it in your favorite IDE, and make any search by name. Steps to follow:

    1. Unzip the package
    2. You go to the folder C:/.../your_unzip_package_path/src/Base
    3. In my case, I needed to replace '%2520' in file names by spaces by using this command in PowerShell: Get-ChildItem -Recurse | Rename-Item -NewName { $_.Name -replace '%2520',' ' }
    4. Open the /Base folder i.e. with Visual Studio Code
    5. Make any search by name in the whole project: Ctrl+Shift+F with any code file selected

    I hope it helps
  • krikikriki Member, Moderator Posts: 9,115
    [Topic moved from 'Design Patterns (General & Best Practices)' forum to 'NAV Tips & Tricks' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.