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

Community site session details

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

Custom Report Not Available in Search

(1) ShareShare
ReportReport
Posted on by
Hello, I just started coding with AL for Business Central. I am trying to make a simple report that references the Sales Header and provides me with Order Intake based off of the SystemCreatedAt date and time. I got my code to the point where there are no syntax errors and it has published successfully. I am having an issue with after the code is published, it is not showing up in the search bar in business central. From my understanding, all you need to define for the report to show up is 'UsageCategory' which I have set to 'ReportsAndAnalysis'. Can someone please let me know if I am missing something in my code or if something just seems completely wrong?
 
// Order Intake Report Page
report 50100 /Order Intake/
{
    // The usage category makes the report available in the search
    UsageCategory = ReportsAndAnalysis;
 
    // This is where we define the layout of the report
 
    RDLCLayout = './ReportLayout.rdlc';
    dataset
    {
        // DataItem to hold Sales Header data
        dataitem(SalesHeader; /Sales Header/)
        {
            // Filter to only include Sales Orders
            DataItemTableView = SORTING(/Document Type/) WHERE(/Document Type/ = CONST(Order));
 
            // Columns to display in the report
            column(DocumentNo; /No./)
            {
                IncludeCaption = true;
            }
            column(SellToCustomerName; /Sell-to Customer Name/)
            {
                IncludeCaption = true;
            }
            column(SellToCustomerNo; /Sell-to Customer No./)
            {
                IncludeCaption = true;
            }
            column(TotalAmount; /Amount Including VAT/)
            {
                IncludeCaption = true;
            }
            column(CreatedAt; /SystemCreatedAt/)
            {
                IncludeCaption = true;
            }
        }
    }
    // Request page for the report, allowing the user to filter by the Created At date
    requestpage
    {
        layout
        {
            area(content)
            {
                group(GroupName)
                {
                    field(DateFilterFrom; DateFilterFrom)
                    {
                        ApplicationArea = All;
                        Caption = 'Created Date From';
                        ToolTip = 'Enter the start date to filter the Sales Orders.';
                    }
                    field(DateFilterTo; DateFilterTo)
                    {
                        ApplicationArea = All;
                        Caption = 'Created Date To';
                        ToolTip = 'Enter the end date to filter the Sales Orders.';
                    }
                }
            }
        }
    }
 
    trigger OnPreReport()
    begin
        // Apply the date filter before the report is generated
        if DateFilterFrom <> 0DT then
            SalesHeader.SetRange(/SystemCreatedAt/, DateFilterFrom, DateFilterTo);
    end;
 
    var
        DateFilterFrom: DateTime;
        DateFilterTo: DateTime;
}
  • Gerardo Rentería García Profile Picture
    on at
    Custom Report Not Available in Search
    Hi there, 
    This may help, 
    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-al-menusuite-functionality
    You have to consider as you indicate the UsageCategory property, but you could also experience some problem because of the ApplicationArea property, or AccessByPermission. 
    best regards
    Gerardo
  • Suggested answer
    YUN ZHU Profile Picture
    on at
    Custom Report Not Available in Search
    Hi, a simple example, I hope it can give you some tips.
     
    Thanks.
    ZHU
     
  • Verified answer
    KasparsSemjonovs Profile Picture
    on at
    Custom Report Not Available in Search
    As can be seen in Yun Zhus post - the ApplicationArea property is missing in Your code. And Caption is usually required as well.
     
    If You are on-Prem, You would need also to recheck if the report 50100 is assigned to Your license.
     
    and last action - if You are not using a SUPER user, re-check that the user has the report 50100 in his permissions.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans