Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

How to display a record between different time durations during the day?

(0) ShareShare
ReportReport
Posted on by 873

Hello,

I have multiple checklists that should be filled by the employee's between different time duration and twice a day.

  • Example: Checklist A  should be filled between 6AM - 11AM and 2PM - 6PM
  • Checklist B should be filled between 3PM-4PM and 5PM - 6PM

The main purpose is that when the employee open's the form where he wants to select the checklist, the one that will be displayed in the LookUp view is the one that falls under the same duration of the employee timeZone.

  • Example:If the employee's current time is 6:21 AM Checklist A will be visible and checklist B should not show in the lookup view.

What do you suggest as a solution to implement the above requirements in an effective way?

I thought about two different options but I am still confused about which one I shall proceed with:

  1. Having a scheduled workflow on Power Automate that triggers every 1 hour -> compare current time vs checklist setup -> If it meets the criteria I can set a toggle that indicates if it should be visible Yes/No -> OnLoad of the form where the employee will fill out the checklist the only records that will be showing are the ones visible = true.
    OR
  2. Having a JS onLoad of the form which grabs the current user timeZone -> checks the setup vs current time-> filters the lookupView according to the needed criteria.

Any help is greatly appreciated.

Thank you!

  • EBMRay Profile Picture
    EBMRay 873 on at
    RE: How to display a record between different time durations during the day?

    Hi Adrian Begovich

    I appreciate you providing the documentation below.

    Regarding the show/hide it is not related to a field it is related to a "Record" meaning some FetchXML filters should be applied based on the current timeZone of the user.

    Let me give it a try and get back to you if I get stuck.

    Best regards,

    EBMRay

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: How to display a record between different time durations during the day?

    Hi EBMRay,

    A great solution is to obtain the users local time with on load JavaScript, then show and hide fields representing checklist A and checklist B based on the current time.

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans