- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 09:52 PM
Hello Guys,
When ever a record gets inserted on incident table a datetime field is populated with current date and time.
I have a field on the incident form which has type date/time.
For that I have created the Before Business rule of insert type. Below is my code:-
// Add your code here
var dateTime = new GlideDateTime();
current.setValue('u_request_received_date',dateTime);
current.update();
Now I don't want to use current.update() method. And if I remove this, it does not work.
Please help me with this one 😞
Note: I need to use only Business Rule.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 10:03 PM
Hi,
If you use before insert business rule which you are already using then no need of current.update();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 10:00 PM
Hi,
Try this in your before business rule with-out current.update();
current.u_request_received_date = gs.nowDateTime();
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 10:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 10:37 PM
Hi,
Have you verified by creating a new Record and submit/save it. The script is fine. It should work.
Note - No need to use of current.update(); in before business rule. Its not a best practice, it will goes into recursion.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 10:03 PM
Hi,
If you use before insert business rule which you are already using then no need of current.update();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader