Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

AL Code Help in report

Posted on by 151

Hello All

i have developed a report for the inventory remaining stock. but in our item Master all of the items have Item category and Subcategory is there. but while running the Report those category details was coming only in some of the items. 

how can we correct it?

ITem Master Categories are there

ST2.jpg

Out of the Report
st1.jpg

/// 
/// Report ITEM WISE BY LOC (Stock) (ID 62015).
/// 
report 62015 " ITEM WISE BY LOC (Stock)"
{
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    DefaultRenderingLayout = LayoutName;
    AllowScheduling = true;

    // report is created for getting item/stock report for sales team and Stock Taking

    dataset
    {
        dataitem(Item; Item)
        {
            DataItemTableView = where(Inventory = filter('>0'));
            column(No; "No.")
            {

            }
            column(UnitCost_Item; "Unit Cost")
            {
            }
            column(UnitPrice_Item; "Unit Price")
            {
            }

            column(Description; Description)
            { }
            column(ShowPrice; ShowPrice)
            {
            }


            dataitem(Item_Ledger_Entry; "Item Ledger Entry")
            {
                DataItemLink = "Item No." = field("No.");
                column(ItemNo_Item_Ledger_Entry; "Item No.")
                {
                }
                column(Location_Code; "Location Code")
                {

                }
                column(ItemCategoryCode_Item_Ledger_Entry; "Item Category Code")
                {
                }
                column(ItemParentCagetory_Item_Ledger_Entry; "Item Parent Cagetory ")
                {
                }


                column(Remaining_Quantity; "Remaining Quantity")
                {
                }
            }
        }

    }
    requestpage
    {
        layout
        {
            area(Content)
            {
                group(GroupName)
                {
                    field(ShowPrice; ShowPrice)
                    {
                        Caption = 'Show Price';
                        ApplicationArea = All;

                    }
                }
            }
        }
    }
    rendering
    {
        layout(LayoutName)
        {
            Type = RDLC;
            LayoutFile = '.\ReportLayouts\ITEMBYLOCATION1.rdl';
        }
    }

    var
        ShowPrice: Boolean;

}

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: AL Code Help in report

    Have you added the category after you started posting transactions on the items. You are reporting the Item category and Subcategory from the item ledger entries and they will only show up in your report if they were present when you posted the transaction.

    You can try to get the fields from the item data item instead of the item ledger entries.

  • aryaps Profile Picture
    aryaps 151 on at
    RE: AL Code Help in report

    it is already there. you can see in the above screenshot. in some of the items its coming there but some of the items its not coming.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AL Code Help in report

    Hi, you can add the colum subcategory, parent category to the dataitem --> ITEM have you tried that

  • aryaps Profile Picture
    aryaps 151 on at
    RE: AL Code Help in report

    Could anyone pls help me on this

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans