Skip to main content

Notifications

Dynamics 365 general forum

Filtering view by field of entity where view is displayed

Posted on by 45

Hi everyone,

my problem is as the title says, specifically: I have an entity with a beginning and end date. I would like to display a view on the form of other records of the same entity that are within a week of these dates.

Basically: Display all records that have a beginning date of one week or later BEFORE the begin date of the current entity or a beginning date of one week or earlier AFTER the end date of the current entity.

I'm not sure how to achieve this. The only solutions I've found consist of modifying the FetchXML with a JavaScript web resource, but I've also read that this is not supported and there seem to be differences in syntax between Unified Interface and old interface, so I would rather not go this route.

Is there a robust way to implement this?

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Filtering view by field of entity where view is displayed

    Hi partner,

    You could use calculate field to do this.

    Since you want to put a subgrid on your form, you need to create a 1:N relationship on the same entity.

    Then create a new whole number field and add calculate rule e.g new_field=difflnDays(begindate1, begindate2), the new field will store the days between the two date fields. 

    Then you could add a view filter like if new_field < 7..

    For more details about how to create calculate field, you could refer to my another answer here.

    https://community.dynamics.com/365/f/dynamics-365-general-forum/363570/view-based-on-todays-date

    Hope it helps.

    Best Regards,

    Leo

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans