Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AL(AL0603) An implicit conversion is being performed from a value of type 'Enum' - Source Subtype #6784

Closed
BartPermentier opened this issue Oct 5, 2021 · 3 comments

Comments

@BartPermentier
Copy link

1. Describe the bug
We have created an option field called "Source Subtype" which acts the same way as "Source Subtype" from the standard table 5767 "Warehouse Activity Line".
In BC19 this standard field is still an option which gives a warning when you create a flowfield like you have in table 901 "Assembly Line"."Pick Qty.".
image

2. To Reproduce
Just check the examples from the standard tables or copy the snippet below.

table 50000 "PRETest"
{
    fields
    {
        field(1; "Source Table"; Integer)
        {
            DataClassification = SystemMetadata;
        }
        field(2; "Source SubType"; Option)
        {
            DataClassification = SystemMetadata;
            OptionMembers = "0","1","2","3","4","5","6","7","8","9";
        }
    }
}
tableextension 50000 MyExtension extends "Sales Line"
{
    fields
    {
        field(50000; "PREPick Qty."; Decimal)
        {
            CalcFormula = Sum("Warehouse Activity Line"."Qty. Outstanding" WHERE("Activity Type" = FILTER(<> "Put-away"),
                                                                                  "Source Type" = CONST(901),
                                                                                  "Source Subtype" = FIELD("Document Type"),
                                                                                  "Source No." = FIELD("Document No."),
                                                                                  "Source Line No." = FIELD("Line No."),
                                                                                  "Source Subline No." = CONST(0),
                                                                                  "Unit of Measure Code" = FIELD("Unit of Measure Code"),
                                                                                  "Action Type" = FILTER(" " | Place),
                                                                                  "Original Breakbulk" = CONST(false),
                                                                                  "Breakbulk No." = CONST(0)));
            Caption = 'Pick Qty.';
            DecimalPlaces = 0 : 5;
            Editable = false;
            FieldClass = FlowField;
        }
    }

}

3. Expected behavior
The behavior is fine for me but tell me what we need to do to fix this issue. I tried changing the type to Integer but then I get a similar error. I checked BC19 Base Artifacts but you still haven't fixed the warning.

4. Actual behavior
I get a warning.

5. Versions:

  • AL Language: v8.1.525271
  • Visual Studio Code: 1.60.2 (User setup)
  • Business Central: 19.0.29894.30923
  • List of Visual Studio Code extensions that you have installed: AL Language
@dzzzb
Copy link

dzzzb commented Oct 5, 2021

related: microsoft/ALAppExtensions#14372

@BartPermentier
Copy link
Author

Thanks I did not find a related issue.
We'd love a solution to this before we send our app to AppSource. I'd rather not start with setting fields deprecated within the next few months of the initial release.
Thanks!

@nndobrev
Copy link
Contributor

nndobrev commented Oct 7, 2021

Sorry for not being able to help here and thank you for reporting this issue but I need to close it as it looks like a duplicate of 14372. Feel free to contribute to the issue linked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants