- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2017 08:30 AM
I have a field on Catalog Item "other_interested_parties"( Referring User Table and its a List Collector). When the user adds users to that field and submit the request then the people in that field should be added automatically to watchlist. I know we can do this after Business Rule (Insert).
Can any one please provide with code which helps me alot.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2017 09:11 AM
So your modified code should be
if(current.variables.other_interested_parties)
{
current.watch_list = current.variables.other_interested_parties;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2017 09:07 AM
Yes. It will apply to all catalog items if the variable name is same in all catalog.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2017 09:11 AM
but i am sorry Sanjeev, the name is same but the value of field in each SR is different.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2017 09:08 AM
Thanks for the update. It will apply to all the catalog items as long as the variable name is correct. You can also include one more condition to check if the field has a value or not. If it has a value then copy the variable list collector to watch list.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2017 09:11 AM
So your modified code should be
if(current.variables.other_interested_parties)
{
current.watch_list = current.variables.other_interested_parties;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2017 08:33 AM
Write a before business rule in sc_req_item
current.watch_list = current.variables.other_interested_parties;
If you need the watchlist to be populated in catalog task, write a before business rule in sc_task
current.watch_list = current.request_item.variables.other_interested_parties;
Please mark this response as correct or helpful if it assisted you with your question.