Reply To: Flowfields only when not blank

  • Steven Chinsky MVP

    Member
    February 5, 2024 at 4:53 pm
    Up
    0
    Down
    ::

    Jonathon – Here is my developers reply as a sample…

    If you have a flowfield and you want the drilldown to show a different set of data you can write code in the ondrilldown trigger.

    This example has a flowfield for the sum of the Item quantity, but if you drill down – you’ll get the sales orders. I didn’t do anything but filter on the order, but you can see how it is as an example. This is a basic sample based on what I understand is the ask. It may be done differently with different requirements.

    table 50100 “DEV New Table”

    {

    Caption = ‘New Table’;

    DataClassification = CustomerContent;

    fields

    {

    field(1; “Item No.”; Code[20])

    {

    Caption = ‘Item No.’;

    TableRelation = Item;

    }

    field(15; “Quantitiy”; Decimal)

    {

    CalcFormula = sum(“Item Ledger Entry”.Quantity where(“Item No.” = field(“Item No.”)));

    Caption = ‘Quantity’;

    DecimalPlaces = 0 : 5;

    Editable = false;

    FieldClass = FlowField;

    }

    }

    keys

    {

    key(PK; “Item No.”)

    {

    Clustered = true;

    }

    }

    }

    page 50100 “DEV New Page”

    {

    ApplicationArea = Basic, Suite;

    Caption = ‘New Page’;

    Extensible = false;

    PageType = List;

    SourceTable = “DEV New Table”;

    UsageCategory = Lists;

    layout

    {

    area(Content)

    {

    repeater(DevControl1)

    {

    field(Item_No; Rec.”Item No.”)

    {

    }

    field(Quantitiy; Rec.Quantitiy)

    {

    trigger OnDrillDown()

    var

    SalesHeader: Record “Sales Header”;

    begin

    SalesHeader.SetRange(“Document Type”, “Sales Document Type”::Order);

    Page.RunModal(Page::”DEV Sales List”, SalesHeader);

    end;

    }

    }

    }

    }

    }

    page 50101 “DEV Sales List”

    {

    ApplicationArea = Basic, Suite;

    Caption = ‘Sales List’;

    Editable = false;

    Extensible = false;

    PageType = List;

    SourceTable = “Sales Header”;

    UsageCategory = None;

    layout

    {

    area(Content)

    {

    repeater(DevControl1)

    {

    field(DocumentType; Rec.”Document Type”) { }

    field(No_; Rec.”No.”) { }

    field(ExternalDocumentNo; Rec.”External Document No.”) { }

    }

    }

    }

    }

    Thanks,

    Steve

Welcome to our new site!

Here you will find a wealth of information created for people  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!