Watch list on case showing different users than users added in the watch list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 09:35 AM
I added logs for the value it shows the correct sys_ids of the users.
There are no other business rules for the watch list field on Case table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 10:01 AM
Always force sys_ids to a string when pushing them to an array or adding them to a string variable with toString() or getValue.
watch_list = watch_list + ',' + gr.user.toString();
If you are still getting unexpected results, add some logs to confirm the records and users returned by the GR, and the changing value of watch_list if necessary until you see where it's going wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 10:35 AM
Hi @Brad Bowman
Thank you for responding.
When I log the watch_list is has the right sys_ids when I assign that to current.watch_list on case it shows different users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 12:09 PM
That's really odd, but there must be an explanation. If you log watch_list right before the last if block, and current.watch_list at the end, both logs contain the expected values? Is this a BR running before Insert? Are the users from watch_list and current.watch_list included but there are extra, or are all of the users different?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 12:29 AM
Thank you for your suggestion,
It is working odd for a particular account but working fine for rest of them.