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...
Suggested Answer

Filtering on a temporary table

(0) ShareShare
ReportReport
Posted on by 50

Hi everyone,
I want to filter with a data range on Customized Calendar Changes (Base Calendar) table, but I can't do it because it is a temporary table. The table fills with information when the user opens it. Can anyone help me and tell how to filter on it?
I want to filter with a specific period of time (from first day of month to last day of month) on Date field and for that period I want to count the Working Days (from Monday to Friday).

pastedimage1667984668202v1.png

I have the same question (0)
  • Suggested answer
    IB-29041624-0 Profile Picture
    1,177 Moderator on at

    There should be no difference in the way you filter on an ordinary table and a temporary table as long as your temporary table is still in scope of your code.

    Maybe you can share the code you are running, then it is easier to assist you.

  • Reni Profile Picture
    50 on at

    FOutputDate is the first date of the month and EOutputDate is the last day of month. When this error message shows up,  " Error(Text000, FOutputDate, EOutputDate, day2); " the "day2" variable has the value 0

    dataitem("Customized Calendar Change"; "Customized Calendar Change")

           {

               trigger OnAfterGetRecord()

               var

                   CCC: Record "Customized Calendar Change";

               begin

                   CCC.SetRange(Date, FOutputDate, EOutputDate);

                   if CCC.FindSet() then begin

                       if CCC.Nonworking = false then begin

                           day2 := ccc.Count;

                       end;

                   end;

               end;

           }

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,177 Moderator on at

    Is this from a page or a report?

    If the "Customized Calender Change" table is defined as temporary in the table definition that means that you CCC variable will always be empty in the way you have organized your code here.

    Because the data item for your report and the CCC variable are two different instances of the temporary table.

    So even if you have populated the data item those records will never be in the scope for your CCC variable.

    You need to populate the CCC variable with data before you can do a count on that table.

    So either you need to copy the data from your data item or you need to totally reorganize your code.

  • Reni Profile Picture
    50 on at

    This code was from a report (Processing Only). How can I copy the data of Customized Calender Change to another table (non temporary) ?

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,012 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 986 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 659 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans