Skip to main content
Solved

FSM Business rule to compare datetime field

  • November 3, 2021
  • 2 replies
  • 389 views

Forum|alt.badge.img+6

Hi team , 

 

Can anyone tell me ,how can we write the input condition to compare the datetime field with current date and time in Business rule .

example : If the expiration date is on or before today date then business rule needs to fire .

I tried giving the input condition with less than and now() function ,but its not working.

 

Thanks

Muthujayashree R

 

Best answer by Hasara Dinu

Hi @Muthujayashree,

Please refer the below example. You can use expressions to achieve this.

 

In the rule input, select the ‘USE EXPRESSION’ option without adding any table or column name

 

You need to add the below expression Inside the input parameters.

 

Expression = request.expiration_dttm<= Today()

 

Thanks,

Hasara

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+13
  • Hero (Employee)
  • 68 replies
  • Answer
  • November 3, 2021

Hi @Muthujayashree,

Please refer the below example. You can use expressions to achieve this.

 

In the rule input, select the ‘USE EXPRESSION’ option without adding any table or column name

 

You need to add the below expression Inside the input parameters.

 

Expression = request.expiration_dttm<= Today()

 

Thanks,

Hasara


Atheeq Maharoof
Superhero (Employee)
Forum|alt.badge.img+12

Hi @Muthujayashree ,

If your requirement is to validate the expiration_dt when the value is changed, you can write a client script and attach to the expiration_dt by mentioning the event as AfterValueChanged for Web Client and TextChanged for Smart Client. Note that the business rule triggers on the specified execution point (if its Before insert or update then the rule will triggered when pressing the save button) .

In the script you can get the specific expiration_dt value and compare with the the current date .

var now = new Date();

var dateOnly = formatDate(now, 'dateonly');


Hope this answer helps.

Best Regards,
Atheeq


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings