Get current date on a Business Rule

anirban300
Kilo Guru

How can I fetch current date on a After Query/Update business Rule?

1 ACCEPTED SOLUTION

can you help me out with the full code here.

 

if you are writing the BR on the kb_knowledge table,then use

var gDate = new GlideDate();

 current.valid_to =gDate;

current.update(); //based on your when to run condition use this one.

 

If the business rule is before insert or update BR, then system automatically does an update on the database when the script runs, and it doesnt need another current.update() in the script.

 

 

 

 

 

View solution in original post

5 REPLIES 5

Simon Ohle
Kilo Guru

I didnt even use the advanced script. I just selected the date field under "Actions" and used this as a parameter:

 

 

javascript:gs.nowDateTime()

 

 



SimonOhle_0-1670489677765.png