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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Best way to prevent a future date on a custom field - Real-time workflow not working

(0) ShareShare
ReportReport
Posted on by 14

Requirement:

I need to stop users from entering a future date in a "Date and Time of Data Breach" field. If the selected date is later than today, it should be blocked with an error message. Past and current dates should be allowed. This has to be achieved using OOTB. No-code features , JavaScript or plugins.

Field details: custom entity (Data Breach), field il_dateandtimeofdatabreach, behaviour = User Local, format = Date and Time. The Data Breach entity is related to Case, and the field is entered via the Case form (Data Breach tab). Environment: D365 Customer Service, model-driven.

What I tried (and didn't work):

I built a real-time workflow on the Data Breach entity (scope Organization, trigger on Record Created):

  • Condition: If Date and Time of Data Breach > [anchor], then Stop Workflow → Canceled with a custom error.

I tried three different anchors for "today":


  • The Data Breach record's own Created On

  • The related Case's Created On

  • Process-Execution Time

In every case, when I create a record with a clearly future date (e.g. today 19 June, breach date 24 June), the workflow job shows Succeeded — it never reaches the Cancel step and the record saves with no error. Logically Process-Execution Time = now, so the condition should be TRUE, but it Succeeds every time.

Other OOTB options I'm aware of 

  1. Formula column with Now() (since calculated columns are deprecated) + a business rule to show the error.
 
 
Given the no-code constraint, is the workflow approach viable at all for this? Or is a formula column + business rule the right OOTB route? And is there a reason a real-time Create workflow would consistently fail to read the field value for this comparison?

 

I have the same question (0)
  • Suggested answer
    ManoVerse Profile Picture
    1,281 Super User 2026 Season 1 on at
    1. Create a Formula column (Date/Time) 
    Expression : Now() or UtcNow() if you want consistency regardless of user local format
    2) Create business rule or DataBreach
    Condition 
    il_dateandtimeofdatabreach > [Your Now() formula column]
    Action:
    -> Show error message
    -> Set field as invalid (or clear it)
    This works client-side and server-side (if scoped properly) and would be no code approach as per your requirement.
    Real-time workflows are unreliable here because they don’t consistently evaluate User Local DateTime fields during the create stage due to timezone conversions and execution timing, so the “current time” comparison never evaluates as expected.
    If this helps , mark this answer as verified which will help other community member to find right solutions

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 142 Super User 2026 Season 1

#2
Nagaraju_Matta Profile Picture

Nagaraju_Matta 128

#3
11manish Profile Picture

11manish 103

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans