- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 07:13 AM
Hi
How can i set the value of a field(work start) to current Date Time based on another filed's value in a business rule action?
Regards.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 07:28 AM
Hi John,
Please see the link below.
Set date via business rule action
Regards,
Harshvardhan
PS - Please mark Helpful, Like, or Correct Answer if applicable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2018 07:00 AM
Since you are updating fields on the current object, this should be a BEFORE business rule (and remove current.update().)
Your script can then look like this:
var now = new GlideDateTime();
current.u_resolved_on_date = now;
if u_resolved_on_date is a DATE (and not a date/time field) use this:
var now = new GlideDate();
current.u_resolved_on_date = now;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2018 02:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2018 04:13 AM
I tried in my personal instance so many ways.
1. Before--> insert or update
2. Before--> insert
3. Before --> Update
3. After -->insert
4. After --> update
5. After --> insert or update
When state changes to closed complete, the resolved date field should set the current date and time.
I took field type as "date/time".
"Actual requirement is we need to set the resolved state field with current date and time---> when state changes to resolved"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 07:28 AM
Hi John,
Please see the link below.
Set date via business rule action
Regards,
Harshvardhan
PS - Please mark Helpful, Like, or Correct Answer if applicable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 07:30 AM
Use javascript:gs.nowDateTime() in your conditions.