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?
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156