Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

BC-Drilldownpage in Cue auto generated "views" in the linked page. How to control it?

Posted on by 4
Business Central - Drilldownpage in Cue auto generated /views/ in the linked page. How to make the views in my control?
 
I made some cues displayed sales order amount by team as of today like below.
The AL code is like below.
                field(SalesOrderAmountTodayB2B_SalesTeam; TotalB2BAmt)
                {
                    ApplicationArea = ALL;
                    ToolTip = 'The sum of B2B sales order today.';
                    Caption = 'B2B';
                    DrillDownPageID = /Sales Order List/;
 
                    trigger OnDrillDown()
                    begin
                        DrillDownSalesOrderTodayByTeam('B2B_T', 'ALL', gtxTodayDate);
                    end;
                }
 
 
When a user click the cue, it drills down to the order list page like below.
It looks BC generate views automatically for the all the cues with DrillDownPageID value with the text values of caption properties.
It makes some problems.
 
1. The auto-generated views push down the other user defined views. Users should scroll down the view list to find their own view. It just clicked one of the cues, but the views are generated for the all of the cues. And some of them have duplicated names, it makes users confused.
1) Is there any solution to hide the view list?
2) Is there any solution to change the name of the view? It looks derived from the /caption/ values in the cues.
 
2. Even I move out to another page and open the /Sales Orders/ list page again (not through the /cues/), it remains the autogenerated views.
- If #1 is not possible, Is a way to reset the views when user move out to another page to clear out the auto generated views?
 
Categories:
  • Ian Pak Profile Picture
    Ian Pak 5 on at
    BC-Drilldownpage in Cue auto generated "views" in the linked page. How to control it?
    So, I am trying to find and develop the alternate way instead of using FlowField.
    I read the cue of "Overdue Sales Invoice Amount" in the cue page "O365 Activities" as below.
     
     
    When [See more] is clicked in the cue "Overdue Sales Invoice Amount", it moves to the drilldown page to the PAGE::"Customer Ledger Entries" as below.
    1. Title is chages to "Overdue Sales Invoice Amount"
    2. No view generated according to the cue. Only Filters set as defined in cue.
     
     
    In page 1310 "O365 Activities"
                    field("Overdue Sales Invoice Amount"; Rec."Overdue Sales Invoice Amount")
                    {
                        ApplicationArea = Basic, Suite;
                        ToolTip = 'Specifies the sum of overdue payments from customers.';
     
                        trigger OnDrillDown()
                        begin
                            ActivitiesMgt.DrillDownCalcOverdueSalesInvoiceAmount();
                        end;
                    }
     
    In codeunit 1311 "Activities Mgt."
        procedure DrillDownCalcOverdueSalesInvoiceAmount()
        var
            [SecurityFiltering(SecurityFilter::Filtered)]
            CustLedgerEntry: Record "Cust. Ledger Entry";
            IsHandled: Boolean;
        begin
            IsHandled := false;
            OnBeforeDrillDownCalcOverdueSalesInvoiceAmount(CustLedgerEntry, IsHandled);
            if IsHandled then
                exit;
     
            SetFilterOverdueSalesInvoice(CustLedgerEntry, false);
            CustLedgerEntry.SetFilter("Remaining Amt. (LCY)", '<>0');
            CustLedgerEntry.SetCurrentKey("Remaining Amt. (LCY)");
            CustLedgerEntry.Ascending := false;
     
            PAGE.Run(PAGE::"Customer Ledger Entries", CustLedgerEntry);
        end;
     
    I did almost same way except the code is not in the "Acitivities Mgt.". I made the procedure in the cue pageextension.
     
    DrillDownSalesOrderTodayByTeam('B2B_T', 'ALL', gtxTodayDate);
     
    procedure DrillDownSalesOrderTodayByTeam(pSalesTeamCode: Text; pSalesChannel: Text; pDate: Date)
    ...
            SalesHeaderEntry.SetFilter(...);
            //SalesHeaderEntry.SetRange("Posting Date", CalcDate('<-CM>', GetDefaultWorkDate()), GetDefaultWorkDate());
            IF NOT SalesHeaderEntry.IsEmpty THEN BEGIN
                PAGE.Run(PAGE::"Sales Order List");
            END;
     
    But it opens the page with a generated view named with the caption of the cue.
    Do I miss something?
  • Ian Pak Profile Picture
    Ian Pak 5 on at
    BC-Drilldownpage in Cue auto generated "views" in the linked page. How to control it?
    Dear @Yun Zhu,
     
    Thank you for your reply.
    (I am the person posted this issue. For some reason, I cannot post with the user account I posted, it keeps asking to check terms and conditions and cannot login properly with the account.)
     
    Actually, I cannot use FlowField for the cue. It gets the sum of Sales Line Type "Item" of the orders filters "Document Date"(Order Date) in Sales Header table.
    As I know CalcFormula cannot have filter related more than 2 tables. 
     
            field(50109; FreightAmount; Decimal)
            {
                FieldClass = FlowField;
                CalcFormula = sum("Sales Line".Amount where("Document Type" = filter(= 'Order')
                                                            , "Type" = filter(= 'Resource')
                                                            , "No." = filter(= 'FREIGHT-CHARGE')
                                                            //, "Sales Header"."Document Date" = filter(= '2/14/2024')//<= cannot filter like this.
                                                            ));
     
                AutoFormatExpression = GetAmountFormat;
                AutoFormatType = 11;
                Caption = 'Freight';
                DecimalPlaces = 0 : 0;
            }
     
     
    I tried to make a tableextension to get "Document Date" from "Sales Header" to "Sales Line" as below, but it does not get the value. "CS_DocumentDate" is always blank.
    tableextension 99999 "SalesLine Ext" extends "Sales Line"
    {
        fields
        {
     
            field(80002; CS_DocumentDate; Date)
            {
                Caption = 'Document Date';
                Editable = false;
                TableRelation = "Sales Header"."Document Date" where("No." = field("Document No."));
            }
        }
    }
     
    If it is SQL DB, I can get the amount like this, (this query is just to explain the logic. Not a practical one.)
    SELECT SUM(Amount) TodaySalesAmt
    FROM SalesLine
    JOIN SalesHeader
       ON SalesLine.DocumentType = SalesHeader.DocumentType
      AND SalesLine.DocumentNo = SalesHeader.DocumentNo
    WHERE SalesHeader.DocumentDate >= Today
    AND SalesLine.Type = 'Item'
     
     
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 68,395 Super User 2024 Season 2 on at
    BC-Drilldownpage in Cue auto generated "views" in the linked page. How to control it?
    Hi, this is very strange. A new view should not be created. What is the code in DrillDownSalesOrderTodayByTeam? Just filter and Page.run?
    And have you tried using Flowfield? The standard is to use Flowfield, which does not have this problem.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
     
     

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans