Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Page Extention - add field - error in Visual Studio Code AL

(0) ShareShare
ReportReport
Posted on by 32

Hello,

We are going online soon with Dynamics Business Central. Our Application Version is 21.1.48363.48789. Sandbox.
Trying to add an extra flowfield to Item List - "Qty. to Ship" from Sales Line.
Have created (my first ones) a table and a page extention in Visual Studio Code AL with the code below. 

Table extention works fine, I can add the field "Qty. to Ship" to Item List with Designer - would like to add the field with a page extention but it gives me error "The name "Qty. to Ship" does not exist in current context" 

Will be glad for help:)

Tableextension 50100 qtytoshipExt extends "Item"
{
    fields
    {
        field(50100; Qty_to_Ship; decimal)
        {
            Caption = 'Lever på ordre';
            DecimalPlaces = 0 : 5;
            Editable = false;
            FieldClass = FlowField;
            CalcFormula = Sum("Sales Line"."Qty. to Ship" WHERE("Document Type" = const(Order), Type = const(Item), "No." = field("No."), "Qty. to Ship" = FILTER(> 0)));
        }
    }
    var
        myInt: Integer;
}

pageextension 50100 pqtytoshipExt extends "Item List"
{
    layout
    {
        addafter(InventoryField)
        {

            field("Qty. to Ship"; "Qty. to Ship")
            {
                ApplicationArea = All;
                Caption = 'Lever på ordre';
            }
        }
    }

    var
        myInt: Integer;
}

  • Suggested answer
    Amit_Sharma Profile Picture
    Amit_Sharma 2,545 on at
    RE: Page Extention - add field - error in Visual Studio Code AL

    Hi,

    adding info

    https://erpconsultors.com/page-extension-overview-in-business-central-d365/

    Regards
    Amit Sharma
    www.erpconsultors.com
    Press Yes if Info is useful

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,274 Super User 2024 Season 1 on at
    RE: Page Extention - add field - error in Visual Studio Code AL

    hahaah

    it happens to everyone !!!

  • Groefte Profile Picture
    Groefte 32 on at
    RE: Page Extention - add field - error in Visual Studio Code AL

    ... need new glasses :) - thanks it is working.

  • Verified answer
    DAnny3211 Profile Picture
    DAnny3211 9,274 Super User 2024 Season 1 on at
    RE: Page Extention - add field - error in Visual Studio Code AL

    hi

    try this

    pageextension 50100 pqtytoshipExt extends "Item List"

    {

       layout

       {

           addafter(InventoryField)

           {

               field("Qty. to Ship"; Rec.Qty_to_Ship)

               {

                   ApplicationArea = All;

                   Caption = 'Lever på ordre';

               }

           }

       }

       var

           myInt: Integer;

    }

    your field's name is Qty_to_Ship , not "Qty. to Ship"

    check my answer if it helped you, thanks

    DAniele

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,602 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,340 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans