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
728 stars 241 forks source link

Unexpected value 'NoConversion' of type 'Microsoft.Dynamics.Nav.CodeAnalysis.ConversionKind' #7626

Closed sergiogp1 closed 7 months ago

sergiogp1 commented 8 months ago

1. Describe the bug My environment in SaaS can't upgrade to v23.0 because it's throwing this compilation error:

Per-tenant extension 'XYZ' version 1.0.0.25 by 'ABC' failed to compile. Failure while emitting method. Object:'Codeunit "ABC Create Item Jnl. Lines"' Method:'SetLine(var Record "ABC Staging Order Item" temporary)' (Unexpected value 'NoConversion' of type 'Microsoft.Dynamics.Nav.CodeAnalysis.ConversionKind') Unexpected value 'NoConversion' of type 'Microsoft.Dynamics.Nav.CodeAnalysis.ConversionKind'

2. To Reproduce Unable to reproduce in my local environment with v23.0 in app.json. The code is like this:

codeunit 70002 "ABC Create Item Jnl. Lines"
{
    TableNo = "ABC Staging Order Item";

    trigger OnRun()
    begin
        SetLine(Rec);
    end;

    internal procedure SetLine(var StagingOrderItem: Record "ABC Staging Order Item" temporary)
    begin
    ...

3. Expected behavior I expect that the environment can upgrade.

4. Actual behavior Environment can't upgrade

5. Versions:

Final checklist

Please remember to do the following:

The error is very generic. How can I solve it?

BazookaMusic commented 8 months ago

Is this table "ABC Staging Order Item" in the same app or another PTE that this depends on? This looks like a dependency issue where the other table cannot be found and thus the type of Rec is not resolved

sergiogp1 commented 8 months ago

Yes, it's in the same app. That code has been working for at least 2 years.

sergiogp1 commented 7 months ago

I found the reason of the error. I will open a new issue and close this one.