web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Time based JavaScript Alert/ Warning

(0) ShareShare
ReportReport
Posted on by 40

Hi Team

Is there any way of creating a time based alert in CRM. ie between the hours of 10pm - 4am display a warning on the entity record to display there is an outage?

cheers

I have the same question (0)
  • Verified answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    There is no OOB way to do this, you could refer to the below steps.

    1.We could show notifications in D365 form by JS code.

    function showNotification(executionContext){
    formContext.ui.setFormNotification("Your Message Here", "WARNING", "No1");
    }

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-ui/setformnotification

    Add this code into a useless fieldA onchange event.

    2.We could hide notification in D365 form by JS code as well.

    function hideNotification(){
    formContext.ui.clearFormNotification("No1");
    }

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-ui/clearformnotification

    Add this code into another useless fieldB onchange event.

    3.Create a Scheduled Flow.

    In your case, choose the start time to 10:00 PM, and then repeat it every day.

    pastedimage1589855654424v1.png

    Then we add  an update action for D365 in Flow, update the field A, so that when Flow update field A everyday 10:PM, the field A onchange event will be triggered, which means the JS function "showNotification" will run, and show the notification on the form.

    4.Create another Scheduled Flow to let it run at everyday 4:00 AM, and create an update action to update the field B to trigger "hideNotification" function to hide the notification.

    Best Regards,

    Leo

  • Suggested answer
    Van le Profile Picture
    40 on at

    excellent!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 96 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans