Edit

Share via


AppSourceCop Hidden AS0132

Fields with schema should not be added.

Description

Fields with schema should not be added.

Remarks

This rule is not enabled by default since additive changes are generally allowed.

How to fix this diagnostic?

Revert the changes done by removing the fields that have been added.

Examples triggering this rule

Example 1 - Adding a field to a table with schema

Version 1 of the extension

table 50100 MyTable
{
    fields
    {
        field(1; MyField; Integer) { }
    }
}

Version 2 of the extension

table 50100 MyTable
{
    fields
    {
        field(1; MyField; Integer) { }
        field(2; MyNewField; Integer) { } // New table field.
    }
}

Example 2 - Adding a field to a table extension with schema

Version 1 of the extension

tableextension 50100 MyExtension extends SomeTable
{
    procedure MyProcedure()
    begin
    end
}

Version 2 of the extension

tableextension 50100 MyExtension extends SomeTable
{
    fields
    {
        field(50100; MyExtField; Integer) { } // New table extension field.
    }

    procedure MyProcedure()
    begin
    end
}

Examples not triggering this rule

Example 1 - Adding a field to a table without schema

Version 1 of the extension

table 50100 MyTable
{
    TableType = Temporary;

    fields
    {
        field(1; MyField; Integer) { }
    }
}

Version 2 of the extension

table 50100 MyTable
{
    TableType = Temporary; // Temporary tables don't contribute to the schema.

    fields
    {
        field(1; MyField; Integer) { }
        field(2; MyNewField; Integer) { }  // New table extension field.
    }
}

Example 2 - Adding a field without schema

Version 1 of the extension

table 50100 MyTable
{
    fields
    {
        field(1; MyField; Integer) { }
    }
}

Version 2 of the extension

table 50100 MyTable
{
    fields
    {
        field(1; MyField; Integer) { }

        field(50100; MyNewField; Integer)
        {
            FieldClass = FlowField; // FlowFields don't contribute to the schema.
        }
    }
}

AppSourceCop Analyzer
Getting Started with AL
Developing Extensions