Skip to main content
Question

Business Rule for Comparing 2x dates in a Catalog Item

  • December 9, 2024
  • 4 replies
  • 33 views

Jason.Evans2
Apprentice
Forum|alt.badge.img+1

I would like to to compare 2x dates 

i.e.

D1: Date From (item.Fields.Date from)
D2: Date To (item.Fields.Date to)

I want to check if the D2 does not exceed 1 year of D1 if it does I would like the Business Rule to throw my content error.

Could anyone help please. 

Thanks 🙂

4 replies

ITMike
Top Contributor ⭐
Forum|alt.badge.img+9
  • Top Contributor ⭐
  • December 9, 2024

as far as I’m aware there are no “calculated verification” capabilities. You can create an automator to run a test on a certain field after the ticket is created and then perform an action like delete email the requester for an update etc, but nothing to stop them at the time of entry.


Roxwell
Top Contributor ⭐
Forum|alt.badge.img+9
  • Top Contributor ⭐
  • December 10, 2024

As ​@ITMike said, you cannot do a calucation on the form. You COULD do it after form submission,

 

Event - When SR raised is ‘Your SR”

Expression - diffInDays([Date.from],[Date.to))

Expression - If([E1.Result]>365,true,false)

Condition - If [e2.Result] = True 

THEN

(Whatever actions you want to take when it’s longer than a year)

ELSE

(Whatever you want to do when it’s less than a year)


Roxwell
Top Contributor ⭐
Forum|alt.badge.img+9
  • Top Contributor ⭐
  • December 10, 2024

 

Explaining how to do it


Forum|alt.badge.img+11
  • Skilled Expert
  • February 18, 2025

I raised an idea a little while ago surrounding the lack of Business Rule options in conjunction with Date/Time fields.

Take a look and give it an upvote if you think it’s worth it.