- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 05:05 AM
Hi Community,
I'm trying to add a user to watchlist whenever an incident is created. SO I created a Business Rule(before insert) on incident table and added the below script but it is not working
(function executeRule(current, previous /*null when async*/) {
gs.addInfoMessage("BI Group");
current.watch_list = "usersys_Id here";
})(current, previous);
I tried to remove the toString() as well but still not working
(function executeRule(current, previous /*null when async*/) {
gs.addInfoMessage("BI Group");
current.watch_list = "usersys_Id here";
})(current, previous);
I can see the info message if I change the business to after insert, but the user is still not adding to watchlist. please help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 05:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 05:13 AM
current.setValue('watch_list', 'sys_id');
Shakeel Shaik 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 05:14 AM
adding sys_id dynamically or its a static sys_id ?
Please check and let us know
Thanks 🙂
Shakeel Shaik 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 05:17 AM
I'm using static sys_id
current.setValue('watch_list', 'effdb858db7647004e7f71198c961901');
but still not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 05:22 AM
Hi,
It should work, make sure you have added valid user sys_id.
Also try enabling debugger and see if any other BR resetting it.
Thanks,
Anil Lande
Thanks
Anil Lande