
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 11:39 PM
Hello Everyone,
I have a requirement whenever i select a category of "Network" in incident table i must auto-populate 2 users name like user#1 , user#2 in watch list
Please help me out how to achieve this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 12:19 AM
Hi Abdul, IN client script use
var a = "sys_idof user1" + ","+ "sys_id of user 2";
g_form.setValue("watch_list", a)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 12:19 AM
Hi Abdul, IN client script use
var a = "sys_idof user1" + ","+ "sys_id of user 2";
g_form.setValue("watch_list", a)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 12:04 AM
You need to do GlideAjax to fetch the data from sys_user table. If know the users be gonna same all the time then you can directly set the value to watchlist.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 12:14 AM
I need to set the same users as of now.
with above sneha script its working but i dont know how to add 2 users at a time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 12:16 AM
Hi Abdul,
Normally people tend to change their minds !!!, If you were go with onchange client script you will have to handle the people that could change their mind.
Walk through,
1. I have opened form at this point there are 3 other people in the watch list, and I have changed the category to "Network", If I understand your req correctly at this change you would want to see total 5 people in the watch list.
2. Before saving the form, I have changed my mind and went with other category =="Hardware" , so your client script has to delete the 2 additional users it added before.
3. But what if the 3 people that they were there during the form layout is actually is one of those whom you wanted to add and because of change in mind in the second step you do not want to delete the guy.
so basically, Before business rule might help to solve this problem little better .. but need to handle all of the above edge cases if you have to go with client script.
Happy Wednesday !!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 11:47 PM
You can have onChange client script to set the value of watchlist.