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

cues having due date of items from Purchase Line table

(0) ShareShare
ReportReport
Posted on by 335

Hi Everyone,

I want to create a cue showing the Due Items from Purchase Line table and Purchase Order Subform page, The cue should show the of count of the number of items having today and future as their Promised Receipt date.

Regards,

Rupali

  • Suggested answer
    Bilal Haider Profile Picture
    487 on at

    You need to create a flow field in related cue table and write cacl formula like this:

    Sum("Purchase Line".Quantity WHERE (Document Type=FILTER(Order),Type=CONST(Item),Promised Receipt Date=FIELD(Date Filter)))

    You also need a new field like Date Filter of class Flow filter. And you should set its value to TODAY and TODAY+1 on opening of this page.

  • Suggested answer
    JAngle Profile Picture
    159 on at

    Although it’s NAV this resource is good as it gives you code samples and two ways of doing it: docs.microsoft.com/.../walkthrough--creating-a-cue-based-on-a-normal-field-and-a-query

  • Rupali Profile Picture
    335 on at

    Thanks ,Can you please also help with how to set up flow filter in code.

  • Suggested answer
    JAngle Profile Picture
    159 on at

    This is a good resource for flowfields: https://youtu.be/xXS3txLkm7k

  • Rupali Profile Picture
    335 on at

    Thanks.

    I have my code below. It gives me  error  that "The New Date Filter field in the Purchase Cue table must be a FlowField".I have already described it as FlowFilter,Can you please help..

    tableextension 50129 PurchCue extends "Purchase cue"

    {

       fields

       {

           // Add changes to table fields here

           field(50121; "New Date Filter"; Date)

           {

               FieldClass = FlowFilter;

           }

           field(50120; PendingItems; Integer)

           {

               FieldClass = FlowField;

               CalcFormula = count("Purchase Line" where("Document Type" = filter(Order), "Type" = Const(item), "Promised Receipt Date" = FIELD( "New Date Filter")));

               Caption = 'Due Items';

           }

       }

    }

    pageextension 50130 PurchseOrdercuepage extends "Purchase Agent Activities"

    {

       layout

       {

           addbefore("Post Arrival Follow-up")

           {

               cuegroup(Itemdue)

               {

                   caption = 'ItemDue';

                   field("PendingItems"; PendingItems)

                   {

                       ApplicationArea = All;

                       Caption = 'Due Items';

                   }

               }

           }

       }

       // actions{}

       trigger OnOpenPage()

       var

           Rec: Record "Purchase cue";

       begin

           Rec.Reset();

           Rec.SetRange("New Date Filter", CALCDATE('<-CM>', TODAY), CALCDATE('<CM>', TODAY + 1));

           Rec.CalcFields("New Date Filter");

    }

  • Verified answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    You have defined New Date Filter has flow filter not as flow field and you can use CalcFields only on flow fields, there is a difference between flow filter and flow field.

    Please check below

    docs.microsoft.com/.../flowfilter-overview

  • Rupali Profile Picture
    335 on at

    Thanks, I removed that field, It is still not filtering the items having Promised Receipt date as Today and tomorrow,It shows all the items that are there in Purchase line Table without filtering anything ,Can you please help?

  • Suggested answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    You are applying a filter on a different record, you need to apply it on the Page Record, remove the variable declaration in the OnOpenPage

    pastedimage1611887792455v1.png

  • Rupali Profile Picture
    335 on at

    I didn't quite understand, if You could Please explain.

  • Verified answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    Remove the variable declaration in the OnOpenPage trigger.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 711 Super User 2026 Season 2

#2
Teagen Boll Profile Picture

Teagen Boll 377 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 367 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans