Add recruiter to watchlist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hi All !
Add the recruiter in the watchlist in HR case table automatically.
Wrote a BR, but not working. kindly help !
TIA
(function executeRule(current, previous /*null when async*/) {
var recruiterID = current.u_recruiter.toString();
if (!recruiterID) {
return;
}
var watchList = current.watch_list.toString();
// 3. Add the recruiter to the watchlist if they aren't already on it
if (watchList.indexOf(recruiterID) === -1) {
if (watchList.length > 0) {
current.watch_list = watchList + ',' + recruiterID;
} else {
current.watch_list = recruiterID;
}
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
34m ago
Hi @HiranamyeeM
Try with Before Update Business Rule with Proper trigger condition.
Script:
(function executeRule(current, previous /*null when async*/) {
var recruiterID = current.u_recruiter.toString();
if (recruiterID)
{
var watchlist = current.watch_list ? current.watch_list.split(',') : [];
if (watchlist.indexOf(recruiterID) == -1)
{
watchlist.push(recruiterID);
current.watch_list = watchlist.join(',');
}
}
})(current, previous);
