Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Open page after clicking field value

Posted on by 65

Hi!

I want to open form, with specific data after clicking a field on my page.

Just like on Customer List (22, List), when I click value in column "No." - customer number. I am redirected to Customer Card (21, Card) with full customer data. 

I have 2 tables:

ParentTable, with unique field "Parent No."
ChildTable, with not unique field "Parent No.".

ChildTable have relation like this:

field(1; "Parent No."; Integer)
{
    Caption = 'Parent No.';
    DataClassification = ToBeClassified;
    TableRelation = ParentTable."Parent No.";
}


I have also 2 pages

First page, that's show list of all parents
Second page, that's show list of all child which match passed "Parent No.".

How should I develop this? Any solutions? :)

Best Regards!

Categories:
  • Alzack18 Profile Picture
    Alzack18 65 on at
    RE: Open page after clicking field value

    Problem solved :)

    I used OnDrillDown() trigger on my page.

    field("Parent No."; Rec."Parent No.")
    {
        ApplicationArea = All;
    
        trigger OnDrillDown()
        var
            ChildTablePage: Page ChildTablePage;
            ChildTableRecord: Record ChildTable;
        begin
            ChildTableRecord.SetRange(ChildTableRecord."Parent No.", Rec."Parent No.");
            ChildTablePage.SetTableView(ChildTableRecord);
            ChildTablePage.Run();
        end;
    }


    Thank you all for help.
    Best Regards!

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Open page after clicking field value
    [quote user="Alzack18"]

    Hi Inge! Thank you for response :)

    I added to my childTable property:

    LookupPageId = [pageId]

    and to my parentPage on field "Parent No." property:

    LookupPageId = [childPageId]

    After I click on "Parent No." value i get small box, with related lines (i don't need this at all). I can click "Open full list" to open childPage with full data. The problem is that when the entire page is opened, all the records contained in the childTable appear, not just those with the corresponding Parent No.

    image_5F00_2022_2D00_12_2D00_28_5F00_155009933.png
    How to fix this? Can I set range on 'Parent No.'? In addition, disabling the appearance of this small window would also be useful. I want to show only full childPage with corresponding "Parent No.".

    Best Regards!

    [/quote]

    That should not be nessesary if you have designed the correct relations between your tables.

    Maybe you can share more of your code so it is easier to assist you. If you do not want to share your code here then you can send me an e-mail or an message.

  • Alzack18 Profile Picture
    Alzack18 65 on at
    RE: Open page after clicking field value

    yzhums thank you for response! :)

    Your advice is very helpful. However, I am more interested in a solution using "DrillDown" to show the whole page with full information. I'm currently struggling with the problem of limiting the displayed data to those linked after "Parent No.".

  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 73,647 Super User 2024 Season 2 on at
    RE: Open page after clicking field value

    Hi, just adding some info for this small box. Hope this can give you some hints.

    Refreshed peek experience on related records

    https://yzhums.com/18357/

    Hope this helps.

    Thanks.

    ZHU

  • Alzack18 Profile Picture
    Alzack18 65 on at
    RE: Open page after clicking field value

    Hi Inge! Thank you for response :)

    I added to my childTable property:

    LookupPageId = [pageId]

    and to my parentPage on field "Parent No." property:

    LookupPageId = [childPageId]

    After I click on "Parent No." value i get small box, with related lines (i don't need this at all). I can click "Open full list" to open childPage with full data. The problem is that when the entire page is opened, all the records contained in the childTable appear, not just those with the corresponding Parent No.

    image_5F00_2022_2D00_12_2D00_28_5F00_155009933.png
    How to fix this? Can I set range on 'Parent No.'? In addition, disabling the appearance of this small window would also be useful. I want to show only full childPage with corresponding "Parent No.".

    Best Regards!

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Open page after clicking field value

    You also might want to use the card page ID property to open a card page where needed.

    learn.microsoft.com/.../devenv-cardpageid-property

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Open page after clicking field value

    You need to define a lookup page where you want to look at related data:

    learn.microsoft.com/.../devenv-lookuppageid-property

    Look at how it is done in the standard code f.ex. on the customer table:

    pastedimage1672234266303v1.png

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans