Closed GreatScott000 closed 7 years ago
Let me first explain the process.
Compiling locally. When you compile in VSCode, we need to have symbol .navx files locally. The compiler looks inside to find the information about the objects your are extending, etc. The compiler looks into the app.json
file and reads the locale
(W1, GB, etc) and expects to find the corresponding .navx file locally. Since you don't have a GB navx file, you would have to use W1 in app.json.
Is there any specific GB customization you need to use in your AL code? For example, do you want to use a field which exists in GB, but not in W1? If not, then W1 symbols should work just fine.
Compiling on the server. When you press F5, the code is compiled on the server and the same story repeats - the server needs to have corresponding .navx files published in the database. Since this is a custom database, these .navx files are missing and the server compilation fails.
In order to publish .navx symbols to the server, you have to use the standard publishing commandlet with the special -SymbolsOnly
flag. I can't try it myself right now, but I can check later today. Let me know if this does not work.
I feel like I am coming into an advance quantum physics course 2 months after it started and no one can point me to the material I missed. Is there documentation on how to use VS Code to create NAV extensions, that start from scratch and not that you have the environment created by some impenetrable process that already has everything set up?
The Publish-NAVApp cmdlet has an undocumented (although there is an example for it) parameter PackageType with a value of SymbolsOnly
. Is this what you mean?
In order to use it I need a NAVM file, how do I create that? Why is there not one for the HelloWorld example? Where were the symbols created from if this file does not exist?
I am not currently using any specific GB field or object but it is only a matter of time.
However the first error I get (using locale
W1)
Error: The request failed with code 422, reason: Extension compilation failed error AL1024: A package with publisher 'Microsoft', name 'System', and a version compatible with '10.0.0.0' could not be loaded.
would seem to indicate that it is the Microsoft_System_10.0.12925.0.navx file that is the culprit. What generated this file? What conditions cause the need for this file?
Okay so, the app.json file is the basis for the manifest file so I assume that internally a NAVM file is created from that and then the NAVX is generated?
app.json
is a manifest, right. It's the old Manifest.xml in a cuter outfit, and with some additions like application locale reference (W1, US, GB, etc).Microsoft_System_<version>.navx
and Microsoft_<your-locale>_<version>.navx
. Let's call these files symbol packages, or simply symbols. Actually, it does not even need these files if you remove platform
and application
properties from the app.json, but that would be a hardly useful extension without any references to the base objects.Publish-NAVApp -PackageType SymbolsOnly
is the command you need to use. Just point this commandlet to your System and Locale packages and publish both of them to the server. At this point you should be able to build in VSCode and publish to the server with F5.
The reason why you get this error:
The request failed with code 422, reason: Extension compilation failed error AL1024: A package with publisher 'Microsoft', name 'System', and a version compatible with '10.0.0.0' could not be loaded.
Is because this is the first missing-dependency-error that happens on the server and publishing does not proceed further. We will look into improving the error output in this case.
In general you're right - for now we only provide the server and database with US symbols loaded. The other configurations will also follow, as well as documentation on how to create and use your own symbols.
Thank you for this last sentence. That for me is the golden nugget! "The other configurations will also follow, as well as documentation on how to create and use your own symbols."
The way I read this is: As a NAV Reseller you can add as many events to the base products as you want with handled pattern and all. Then create your own packages.
This will be great for the adoption of VS Code in the traditional NAV ecosystem.
I am trying to understand this.
As of the July Preview release, I can only build an extension against a W1 database?
I am not, currently, able to produce an extension that references a region specific object or a region modified object?
In July Preview, not as of. We are working on switching back to region specific symbols.
And up to July you could only use the US database? My question is how can I use my GB database? When or how will this be possible?
Providing images with GB and CA setup in the next thing on the radar, but I can't provide the exact date right now. We will keep you posted.
Thank you for the information and your patience. I am just trying to get my arms around this new world. I find it exciting and want to get started.
Hi, I've downloades the latest NAV version 11.0.9394.0 and latest vscdoe AL plugin.
But Page "Customer List" not found, my NAV version is es-ES
{ "version": "0.2.0", "configurations": [ { "type": "al", "request": "launch", "name": "Desarrollo", "server": "http://desarrollo", "serverInstance": "Cronus_2018_19394", "authentication": "Windows", "startupObjectId": 22 } ] }
I suggest that you open a new issue, we don't usually look at old closed issues.
I am trying to take a custom and make it an Extension. I need to use a GB database. I have successfully been able to convert and connect the database to the RTC (see #395 ). The next challenge is to run the HelloWorld extension against it.
I have successfully run the HelloWorld extension against the Demo Database.
Next step, change the "Navision-main" service to use my database. I changed the service and restarted it.
Clearly there are some problems, see below. Questions:
When I run the example I get this the following error. Error Could not publish the package to the server. See Visual Studio Code debug console for more details Close Open launch.json
Debug Window
The customer list page is in the database and is compiled.
Event Viewer shows
launch.json unchanged
app.json unchanged
Noting the locale is set to W1 in app.json I change it to be GB as that is what my database is. Now I get the following when I try and run the extension. The package is not even created.
app.json updated
Error Could not download symbols. Please see the Visual Studio Code output log for more details. Try again Close
The output folder shows:
Event log shows: