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

Notifications

Announcements

No record found.

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

I have the same question (0)
  • Suggested answer
    Bilal Haider Profile Picture
    414 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
    133 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
    133 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,245 Super User 2025 Season 2 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,245 Super User 2025 Season 2 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,245 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,135

#2
YUN ZHU Profile Picture

YUN ZHU 733 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 612

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans