- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2018 05:00 AM
How can I fetch current date on a After Query/Update business Rule?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2018 06:52 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 12:54 AM - edited ‎12-08-2022 12:58 AM
I didnt even use the advanced script. I just selected the date field under "Actions" and used this as a parameter:
javascript:gs.nowDateTime()