Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Converting customized objects to .al files using txt2al converter toolk

Posted on by 3,957

Hi,

I've used the following link to convert my customized objects to al format using https://docs.microsoft.com/en-us/dynamics-nav/developer/devenv-txt2al-tool 
I exported .txt files with -ExportToNewSyntax of the Customized and NAV 2018 Objects.

I'm able the get the DELTA files.
When I'm using txt2al the exe runs with no errors but doesn't generate an .al in the target folder.

4201.Capture.JPG

*This post is locked for comments

  • Verified answer
    Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Converting customized objects to .al files using txt2al converter toolk

    Hi Andrey,

    Actually you're right but I thought if we could do it via TXT2AL then in that it would be great. Unfortunately it didn't work. But, I try using the Integration Event also, I would try to keep the code close tostandard codeunit. Thanks for the help :)

  • Verified answer
    Andrey Baludin Profile Picture
    Andrey Baludin 3,941 on at
    RE: Converting customized objects to .al files using txt2al converter toolk

    I looked at your 12 codeunit delta and i think your task is harder than you think :) Because you can't delete code or change function properties from 12 codeunit with extension.

    You'll have to refactor a lot of code to stay it as much close to standard as you can. And only add extra code.

    Or you should refuse from using extensions for this part of customization and stay it in old way.

  • Verified answer
    Andrey Baludin Profile Picture
    Andrey Baludin 3,941 on at
    RE: Converting customized objects to .al files using txt2al converter toolk

    Ok, I understood.

    I think it's impossible to convert your data to *.al files because AL doesn't have such object as codeunit extension. Standard codeunit can't be converted because it already exists in any database.

    So the only way in your case:

    1. Look around a place where you insert modification in codeunit and find an integration event. (if it's not found or it's impossible to use event - create your own with C/AL).

    2. Create your codeunit in 50000.. range (you can do it directly in vscode or in dev environment and then convert to AL)

    3. Create subscriber event function and place your code there. (make subscription on integration event from p.1)

    4. Publish your extension (or export your codeunit to txt, convert it to *.al with txt2al and make an app)

    So the main idea is :

    1. use table extensions to add fields to tables

    2. use page extensions to add fields and actions on pages

    3. use new codeunits with subscriber event functions to change tables and codeunits logic.

  • Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Converting customized objects to .al files using txt2al converter toolk

    Hey Andrey,

    I've tried creating the .bat and tried running it. I got the same results.

    Is there any way I can make the .AL of the customized objects?? I.e For Example:

    If I've added few lines of code in Codeunit 12 Gen. Jnl.-Post Line. And I want to make .AL to add these customization through the .AL Extension.

    Incase for further clarification you can refer to my files from the following link.

    drive.google.com/open

  • Suggested answer
    Andrey Baludin Profile Picture
    Andrey Baludin 3,941 on at
    RE: Converting customized objects to .al files using txt2al converter toolk

    Try this:

    1. Create new text file with next data:

    txt2al --source=D:\Projects\1\Extensions\Source\DELTA --target=D:\Projects\1\Extensions\target --rename --extensionStartID 50100

    pause

    2. save it to *.bat file

    3. Put this file into C:\Program Files (x86)\Microsoft Dynamics NAV\110\RoleTailored Client

    4. Run it

    Maybe the reason is that txt2al can't convert Delta file. When I tried to do this - i've got an error.

  • Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Converting customized objects to .al files using txt2al converter toolk

    Hi Stefano,

    I've already tried the combinations.

  • Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Converting customized objects to .al files using txt2al converter toolk

    Also with removing --rename ?

  • Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Converting customized objects to .al files using txt2al converter toolk

    Hi Stefano,

    I've tried that as well but I got the same result.

  • Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Converting customized objects to .al files using txt2al converter toolk

    --target must be a folder path, not a .al file. So the first image I see here is correct. Try adding --extensionStartId to your first image and try adding the double quote to the --target path

  • Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Converting customized objects to .al files using txt2al converter toolk

    Hi Stefano,
    I've tried this command as well but I get the same result... No file is created in target path.. Also, I've added multiple delta files to the path as well but I'm not getting any result...6607.Capture.JPG

    Kindly, suggest something regarding this....
    Or a way to customize the standard codeunit through AL.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans