- 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
‎06-10-2020 03:26 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2020 04:03 PM
Change business to before instead of after.
and in add in advance script section
current.u_rca = new GlideDateTime();
make sure to change u_rca to correct field name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2020 08:25 AM
That worked. Thanks Mike and everyone who replied. Much appreciated.