microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
732 stars 243 forks source link

UnprocessableEntity on Publishing app: Extension compilation failed Src/codeunit/...error AL0132 ... does not contain a definition for 'TBUOM_Pallet load' #6150

Closed louagej closed 3 years ago

louagej commented 3 years ago

Situation I've created a simple extension that uses a field from another app. This depended app is installed on my development environment. Symbols are downloaded and I can build my .app file without any errors or warnings. When I want to publish and install my new app, the VSCode debug console return the following message:

[2020-09-17 11:31:58.53] Sending request to https://bc2020cu1w1:7049/BC/dev/apps?SchemaUpdateMode=forcesync&DependencyPublishingOption=default [2020-09-17 11:31:59.32] The request for path /BC/dev/apps?SchemaUpdateMode=forcesync&DependencyPublishingOption=default failed with code UnprocessableEntity. Reason: Extension compilation failed Src/codeunit/TBPCACommonFunctions.Codeunit.al(17,58): error AL0132: 'Record "Item Unit of Measure"' does not contain a definition for 'TBUOM_Pallet load'

To Reproduce Steps and to reproduce the behavior:

  1. Start a new al project in VSCode
  2. Define a depended app in the app.json
  3. Install depended app on development environment
  4. Download symbols in VSCode project
  5. Use a field in your app from the dependend app
  6. Press F5 to build and deploy the app to your development environment
begin
        if (Rec.Type = Rec.Type::Item) and (ItemUnitofMeasure.Get(Rec."No.", Rec."Unit of Measure Code")) then begin
            //"TBUOM_Pallet load" is field from depended app
            Rec."TBPCA_Pallet Load" := ItemUnitofMeasure."TBUOM_Pallet load";
            ...
    end;

Expected behavior Succelfull Publish and install app in development environment

Screenshots image

5. Versions:

Kind regards, Job

qutreson commented 3 years ago

Hi @louagej, can you verify that the reference symbols in your al package cache (see al.packageCachePath setting in VS Code) and the symbols published on the server have the same version? It looks like the symbols in your package cache contain a definition for the Record "Item Unit of Mesure" while the ones on your server do not.

Can you try setting the "al.packageCachePath" to a different folder, download the symbols again and reload VS Code. Does the error appear now in VS Code too?

louagej commented 3 years ago

Dear,

the al.packageCachePath setting in VS Code contains the correct symbols with the same version: I just blured our Customer Name image

I did change the folder and downloaded the symbols again, but that didn't made any difference. The error is not during the build of the app, but during publishing to the development environment.

Below a screenshot of the record "Item Unit of Measure" with the field present in my development environment. image

The symbols on my development environment and the symbols in VSCode also have the same Version No. image

image

qutreson commented 3 years ago

Did you try to reproduce this on the latest developer preview? The build from your server seems to be from 16 CU1.

Can you provide us with some AL projects that would reproduce the issue so that we can investigate it further?

GFR1 commented 3 years ago

Hi, Did you have any news on this issue. I have exactly the same issue using BC 16 CU2

louagej commented 3 years ago

Hi @qutreson ,

the issue seem to be in the app.json. Since BC16.2, you can't leave 'application' in the app.json. As far as one knows , with 16.1, this wasn't an issue :eyes:

After removing this line, the problem was :heavy_check_mark:

Kind regards, Job

Delpixe commented 3 years ago

Hi @louagej ,

It appears that I am facing your same issue,

here is my app.json: image

here is my app dependecies: image

here is the error i get from VS code: image

Could you help me please?

Kind regards, Delpixe

louagej commented 3 years ago

@Delpixe ,

I can only give you the detailed steps I took to :heavy_check_mark: this problem. I hope they can help you as well. :information_source:

Good luck :thumbsup:

Regards, :point_right: Job

Delpixe commented 3 years ago

@louagej

Thanks a lot, it worked !!!

Regards

nvtopalov commented 3 years ago

Same error is show if by mistake you are using AppId which already exist in the database you are trying to publish. I made such a mistake .. you know copy-past the app.json to save time. In my case it didn't save anything :)