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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Send field value Item to Item ledger entries table and page

(0) ShareShare
ReportReport
Posted on by

HI, I have requirement to send field value from item table to item ledger entries table and page. QtyAvailable is a custom field on item table and page which is giving me data based on inventory-qty on sales order. When I am running this extension, I am getting 0.00 in each row on a item ledger entries page in a QtyAvailable field..

Any help please!

1) Item Table:-
tableextension 50107 TableExtItemsCard extends Item
{
    fields
    {
        
        field(50108; "QtyAvailable"; Decimal)
        {
            Caption = 'Qty. Available';
        }
    }
    
    var
        myInt: Integer;
}
2) Item Page:-
pageextension 50112 ItemsPage extends "Item Card"
{
    layout
    {addafter("Qty. on Purch. Order")
        {
            field(QtyAvailable; QtyAvail)
            {
                ApplicationArea = All;
                Caption = 'Quantity Available';
                Editable = false;
            }
        }
    }

    actions
    {
        // Add changes to page actions here
    }
    trigger OnAfterGetRecord()  
    begin
       
        QtyAvail := Inventory - "Qty. on Sales Order";
        Modify();
         end;

    var
        myInt: Integer;
        QtyAvail: Decimal;

}
3) Item Ledger entries table:-
tableextension 50112 ItemLedEntTable extends "Item Ledger Entry"
{
    fields
    {field(50101; QtyAvail; Decimal)
        {
            Caption = 'Qty. Available';
         }
    }
var
        myInt: Integer;
}
4) Item Ledger Entries Page:-
pageextension 50119 ItemLedgerEntriesPage extends "Item Ledger Entries"
{

    layout
    {
        addafter("Remaining Quantity")
        {
            field(QtyAvail; QtyAvail)
            {
                ApplicationArea = Basic, Suite;
                ToolTip = 'Specifies the QtyAvail in the QtyAvail field that remains to be processed.';
                Visible = true;
            }
        }
    }

    actions
    {
        // Add changes to page actions here
    }
    trigger OnAfterGetRecord()
    begin
        ItemAttr.Reset;
        ItemAttr.SetRange(ItemAttr."No.", "Item No.");
        ItemAttr.CalcSums(QtyAvailable);
        RemQty := ItemAttr.QtyAvailable;
    end;



    var
        myInt: Integer;
        ItemAttr: Record Item;
        RemQty: Decimal;
}
I have the same question (0)
  • Suggested answer
    Salah Eddine BENOUALA Profile Picture
    485 on at

    Hi,

    Did you set the fieldclass to Flowfield ?

    Calcsums also use the property SumIndexFields that you have to check

    docs.microsoft.com/.../calcsums-function--record-

     

    -----------------------------------------

    Best Regards,

    Salah Eddine BENOUALA

    Dynamics NAV & 365 Business Central Consultant

    Please verify my answer, if you find it helpful.

    Doing so you'll show others that there was found a solution and you credit my help.

  • Community Member Profile Picture
    on at

    I tried with flowfield and then I export item table and checked value has not been saved in item table QtyAvaiable field. Tha's y flow field on item ledger entries page giving me 0.00. I do not understand why value is not going to item table field column.

  • Suggested answer
    Genie Cetas Profile Picture
    472 on at

    Hi ..

    Please check the below code for flowing filed value from Item Table  to Item Ledger entry table.  i may made some changes in your coding, am using flow field to flow data from Item table to Item ledger entry table, and also please check you Item card page new field mapping, the should be Filed caption and second should be the Field Name(from Item Table).

    1. Item Table

    --------------------

    tableextension 50101 MyNewItemTable extends Item

    {

       fields

       {

           field(50000; QtyAvailabe; Decimal)

           {

               Caption = 'Qty. Availabe';

           }

       }

       var

           myInt: Integer;

    }

    2. Item Page

    ----------------

    pageextension 50101 MyItemPageExt extends "Item Card"

    {

       layout

       {

           addafter("Qty. on Purch. Order")

           {

               field(QtyAvail; QtyAvailabe)

               {

                   Editable = false;

                   Caption = 'Quantity Availabe';

                   ApplicationArea = All;

               }

           }

       }

       trigger OnAfterGetRecord()

       var

           myInt: Integer;

       begin

           QtyAvailabe := Inventory - "Qty. on Sales Order";

           Modify(true);

       end;

       var

    }

    3. Item Ledger Entry Table

    -----------------------------

    tableextension 50102 MyILETableExt extends "Item Ledger Entry"

    {

       fields

       {

           // Add changes to table fields here\

           field(50000; QtyAvail; Decimal)

           {

               FieldClass = FlowField;

               CalcFormula = sum (Item.QtyAvailabe where("No." = field("Item No.")));

               Caption = 'Quantity Available';

           }

       }

       var

           myInt: Integer;

    }

    4. Item Ledger Entries Page

    -------------------------------

    pageextension 50102 MyILEPageExt extends "Item Ledger Entries"

    {

       layout

       {

           addafter("Remaining Quantity")

           {

               field(QtyAvail; QtyAvail)

               {

                   ApplicationArea = All;

               }

           }

       }

       var

           myInt: Integer;

    }

    OutPut:- 

    Item Card 

    -------------------------

    Item-Table.PNG

     

    Item Ledger Entry

    ---------------------------

    ILE.PNG

  • Verified answer
    Olister Rumao Profile Picture
    4,009 on at

    If your field is a Flow Field use

    REC_VARIABLE.CALCFIELDS(FIELDNAME);

    then use this field wherever necessary.

    Thanks.

  • Community Member Profile Picture
    on at

    Hi Thank You Genie.

    I have tried your code, but the same problem I am getting with even my code. If I open first particular item from item card and then if I go to item ledger entries page, then it's working fine.

    But if I do not open item from item card page and directly go to item ledger entries page value still has been showing 0.00. Why? until I open once item card page particular item it's not updating the values in item ledger entries page.

  • Verified answer
    Salah Eddine BENOUALA Profile Picture
    485 on at

    Simply because the calculation of the qty available is triggered on page Item Card

     trigger OnAfterGetRecord()  
        begin
           
            QtyAvail := Inventory - "Qty. on Sales Order";
            Modify();
             end;
      
    You should calculate also in the page item ledger entries before calling the calcsums ;)

     

    -----------------------------------------

    Best Regards,

    Salah Eddine BENOUALA

    Dynamics NAV & 365 Business Central Consultant

    Please verify my answer, if you find it helpful.

    Doing so you'll show others that there was found a solution and you credit my help.

  • Community Member Profile Picture
    on at

    I tried this not working.

    pageextension 50119 ItemLedgerEntriesPage extends "Item Ledger Entries"

    {

       layout

       {

           addafter("Remaining Quantity")

           {

               field(QtyAvail; QtyAvail)

               {

                   ApplicationArea = Basic, Suite;

                   ToolTip = 'Specifies the QtyAvail in the QtyAvail field that remains to be processed.';

                   Visible = true;

               }

           }

       }

       actions

       {

           // Add changes to page actions here

       }

        trigger OnAfterGetRecord()

        var

        ItemAttr: Record Item;

       begin

          ItemAttr.SetRange(ItemAttr."No.","Item No.");

           QtyAvail := ItemAttr.Inventory - ItemAttr."Qty. on Sales Order";

           Modify(true);

            end;

       var

           myInt: Integer;

           ItemAttr: Record Item;

           RemQty: Decimal;

    }

  • Community Member Profile Picture
    on at

    The code does not look too bad - even though I would do it a little bit different:

    But basically it should work properly.

    Especially in the Comment - OnValidate():

    InsertSalesComplainLogs := Rec;

    InsertSalesComplainLogs.SETRECFILTER()

    IF NOT InsertSalesComplainLogs.FINDFIRST THEN BEGIN

     InsertSalesComplainLogs := Rec;

     InsertSalesComplainLogs.INSERT;

    END;

    InsertSalesComplainLogs.Comment := Comment;

    InsertSalesComplanLogs.MODIFY;

  • Community Member Profile Picture
    on at

    I apologize, but I did not get it. This code is about?

  • Community Member Profile Picture
    on at

    I am trying below method but still I am getting 0.00 in QtyAvail. Any idea..?

    pageextension 50119 ItemLedgerEntriesPage extends "Item Ledger Entries"

    {

       layout

       {

           addafter("Remaining Quantity")

           {

               field(QtyAvail; RemQty)

               {

                   ApplicationArea = Basic, Suite;

                   ToolTip = 'Specifies the QtyAvail in the QtyAvail field that remains to be processed.';

                   Visible = true;

               }

           }

       }

       actions

       {

           // Add changes to page actions here

       }

       trigger OnAfterGetRecord()

       var

           ItemAttr: Record Item;

           ItemLedEntry: Record "Item Ledger Entry";

       begin

           ItemAttr.SetRange(ItemAttr."No.", ItemLedEntry."Item No.");

           ItemAttr.CALCFIELDS(Inventory);

           Inv := ItemAttr.Inventory;

           ItemAttr.CALCFIELDS("Qty. on Sales Order");

           qtySO := ItemAttr."Qty. on Sales Order";

           RemQty := Inv - qtySO;

           Modify(true);

       end;

       var

           myInt: Integer;

           ItemAttr: Record Item;

           RemQty: Decimal;

           Inv: decimal;

           qtySO: Decimal;

    }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,986 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,071 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 975 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans