- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 06:18 AM
Hi All,
I want to set a field to particular Date and Time. I wrote a "before business rule" which will trigger when "State" is changed to "Awaiting user info" and i want to set this particular time and date to the field.
I wrote the following script, but it is not working.
(function executeRule(current, previous /*null when async*/) {
var rightNow = new GlideDatetime();
current.setValue(u_aui_time,rightNow.getValue());
})(current, previous);
Kindly provide your valuable inputs
Thanks in advance
dcn
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 06:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 06:34 AM
I believe you need a capital T in GlideDateTime, also I'm not 100% certain that ".getValue()" is necessary, but it shouldn't be hurting anything.
GlideDateTime();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 06:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2020 01:17 PM
Hello,
This did not work for me. I want to set based upon problem state changes to RCA Complete then RCA Completion date to the current date/time in Business Rule.
Thanks,
Chad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2020 01:22 PM
Is the field a datetime field or date field.
If datetime use above. If date try using javascript: gs.now()