Flowfields only when not blank

  • Flowfields only when not blank

    Posted by Jonathan Delfraisse on January 29, 2024 at 11:59 am

    I have a FlowField on a custom table that needs to lookup a value on another custom table. The lookup field in the second table is a secondary key. I can run the table and page that I added it to from the Env Dev and the field works as attended. However, if I View/Edit from the list of these objects, it ignores the first filter and only does the second, which shows the incorrect data (same page). I only want to show this FlowField if the reference field is not blank.

    { 41;;My Field Name;Code20;FieldClass=FlowField;
    CalcFormula=Lookup(OtherTable."My Field Name" WHERE (Field1=FIELD(LookupField),Field1=FILTER(<>''))) }

    We are on Business Central / NAV 2019 (14.0.29530)

    Jonathan Delfraisse replied 9 months, 2 weeks ago 3 Members · 4 Replies
  • 4 Replies
  • Cliff McDaniel

    Member
    February 1, 2024 at 10:51 pm
    Up
    0
    Down
    ::

    @RobbDelprado @SteveChinsky Can you assist Jonathan?

  • Steven Chinsky MVP

    Member
    February 5, 2024 at 11:09 am
    Up
    0
    Down
    ::

    @Jonathan – Let me read the code and reply shortly…

  • 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

  • Jonathan Delfraisse

    Member
    February 6, 2024 at 6:51 pm
    Up
    0
    Down
    ::

    Hello. Thank you for your reply!! The problem I am having is the result of the FlowField.

    I have taken a screenshot of an example. They are from the same page, but the one on the left was “ran” from the Development Environment and the other was from a “List page” (Edit / View). Usally when you click the 3 dots next to a FlowField, it will use the same fields as filters in the list page of the lookup. But it only shows the second filter. The FlowFilter works when I run the table from the Dev Env. as well (only showing a value if the one field is not blank).

    I had an idea as I was typing the above. I switched the order of the two filters. I put the filter <> ” first then the field = Other. Now it seems to be working. <crazy!!!!>

The discussion ‘Flowfields only when not blank’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

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!