Thursday, February 14, 2019

NAV Extensions - NAV 2018+ and Dynamics 365 Business Central - How to make an extension

Dynamics 365 Business Central uses Extensions V2 (All previous versions must be upgraded to v2 to work on Business central)

  • Download Business Central On-Premise from Partnersource
  • Install Business Central On-Premise
  • Import developer license
    • Import-NAVServerLicense BC160 -LicenseData ([Byte[]]$(Get-Content -Path "fin.flf" -Encoding Byte))
  • Enable Developer Service
    • Business Central Administration>Development>Tick Enable Developer Service Endpoint
  • Ensure windows user is setup as Super in Company
  • Download and install Visual Studio Code
    • https://code.visualstudio.com/
    • Click Extensions (Last icon on the top left list, square icon)
      • Search for AL
      • Select AL Language>Install
      • Restart VB Code
      • View>Command Palette>AL:Go!
      • Select Path to store solution
      • Select Launch.json
        • Change "name" from Your own server to server instance name ("BC130")
        • Change "server" to true address path ("http://localhost:8080")
        • Add "port" = 7049
        • Authentication = "Windows"
        • Enable download Symbols
          • View>Command Palette> AL:Download Symbols
        • Add TranlsationFile
          • in app.json
          • Change line "runtime": "2.3"
          • to "runtime": "2.1"
          • After this line,
          • Add line
            • ,"features": ["TranslationFile"]
        • save
      • Publish Extension to environment
        • F5 or AL:Publish
        • Resolve NetFx40_LegacySecurityPolicy error
          • C:\Program Files\Microsoft Dynamics 365 Business Central\130\Service
          • Edit Microsoft.Dynamics.Nav.Server.exe.config in notepad as administrator
          • Find     <NetFx40_LegacySecurityPolicy enabled="true" />
          • change to     <NetFx40_LegacySecurityPolicy enabled="false" />
          • Restart nav service
      • Web client opens with published extension
    • If you try to publish again, you may get the error "cannot synchronize because a newer version is already synchronized"
Sample working launch.json
{
"version": "1.0.0.1",
"configurations": [
{
"type": "al",
"request": "launch",
"name": "BC130",
"server": "http://mypc:8080",
"serverInstance": "BC130",
"port": 7049,
"authentication": "Windows",
"startupObjectId": 22,
"startupObjectType": "Page",
"breakOnError": true
}
]
}

No comments:

Post a Comment