web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

The field ' ' cannot be located

(0) ShareShare
ReportReport
Posted on by 3,510

Hi:

Below in italics is AL code that I'm using in a Sandbox.  This code had always "worked perfectly", until I modified the fields for Average Listeners, Audience Share, and Advertising Revenue to contain FlowField code shown in brackets below.

Ever since I added that code for these three fields, I have been unable to publish my work in Visual Studio Code.

When I try to publish, I receive the following error:

The field 'Average Listeners' cannot be located.  Removing fields is not allowed.

The field 'Audience Share' cannot be located.  Removing fields is not allowed.

The field 'Advertising Revenue' cannot be located.  Removing fields is not allowed.

How do I modify this code to not have this error?

Thanks!

John

 

table 50100 "Radio Show"

{

    fields

    {

        field(1; "No."; Code[20])

        {

            trigger OnValidate()

            begin

 

            end;

 

            trigger OnLookup()

            begin

 

            end;

        }

        field(10; "Radio Show Type"; Code[10]) { TableRelation = "Radio Show Type"; }

        field(20; "Name"; Text[50]) { }

        field(40; "Run Time"; Duration) { }

        field(50; "Host Code"; Code[20]) { }

        field(60; "Host Name"; Text[50]) { }

        field(100; "Average Listeners"; Decimal)

        {

            Editable = false;

            FieldClass = FlowField;

            CalcFormula = average("Listenership Entry"."Listener Count"

            where("Radio Show No." = field("No."), Date = field("Date Filter")));

        }

        field(110; "Audience Share"; Decimal)

        {

            Editable = false;

            FieldClass = FlowField;

            CalcFormula = average("Listenership Entry"."Audience Share"

            where("Radio Show No." = field("No."), Date = field("Date Filter")));

        }

        field(120; "Advertising Revenue"; Decimal)

        {

            Editable = false;

            FieldClass = FlowField;

            CalcFormula = sum("Radio Show Entry"."Fee Amount"

            where("Radio Show No." = field("No."), "Data Format" = filter(Advertisement)));

        }

        field(130; "Royalty Cost"; Decimal) { }

        field(1000; "Frequency"; Option) { OptionMembers = Hourly,Daily,Weekly,Monthly; }

        field(1010; "PSA Planned Quantity"; Integer) { }

        field(1020; "Ads Planned Quantity"; Integer) { }

        field(1030; "News Required"; Boolean) { InitValue = true; }

        field(1040; "News Duration"; Duration) { }

        field(1050; "Sports Required"; Boolean) { InitValue = true; }

        field(1060; "Sports Duration"; Duration) { }

        field(1070; "Weather Required"; Boolean) { InitValue = true; }

        field(1080; "Weather Duration"; Duration) { }

        field(1090; "Date Filter"; Date) { FieldClass = FlowFilter; }

    }

 

    //keys

    //{

    //key(PK; "Entry No.") { Clustered = true; }

    //key(Reporting; "Radio Show No.", Date) { SumIndexFields = "Fee Amount"; }

    //key(Reporting2; Type, "No.", Date) { SumIndexFields = "Fee Amount"; }

 

    //}

    //

}

I have the same question (0)
  • Indira88 Profile Picture
    980 on at

    Hey John,

    Once a field is added in a particular extension if you remove it the environment does not let you do that.

    Once an extension is deployed with a certain field there is no way a field could be removed.

    work arounds:

    1) unpublish the extension deployed ,create a new extension with a different name and id add the fields you want to.

    2)refresh the sandbox with data from the production and then deploy your app again.Hopefully this code is not in the production yet

  • john.ellis Profile Picture
    3,510 on at

    Hi Indira88:

    Thank you, for your quick response!

    I didn't think that I was removing any fields -- just modifying the ones that are already there.

    Is modifying, in this sense, the same thing as removing?

    John

  • Indira88 Profile Picture
    980 on at

    Hey John,

    So interpreting modifying : the old names are longer there so the System is looking for the old names of columns that have been deployed before but is missing hence the error.

    Regards,

    Indira

  • john.ellis Profile Picture
    3,510 on at

    Hi Indira:

    I'm afraid that I don't understand.

    For these three fields, I placed additional code in their brackets.  That's how I modified them.  I didn't remove them.

    What is meant by "the old names are longer there..."?  :)

    John

  • Verified answer
    Indira88 Profile Picture
    980 on at

    Hi,

    converting an existing field to a flow field is not possible, you will have to create new fields as the old fields are registered as normal db table columns you will have to go through either of the 2 steps defined earlier.

  • john.ellis Profile Picture
    3,510 on at

    Ah!  I see, now!

    Thanks, Indira!

    John

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,468

#2
YUN ZHU Profile Picture

YUN ZHU 923 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans