- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 04:51 AM
Hi,
I have a requirement to hardcode an email address to the watchlist for a record producer. Adding the below code to the record producer script does not work, please assist
var add_mail = " cc@joe.com";
current.watch_list = current.watch_list+','+producer.add_email;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2024 03:37 AM - edited 07-26-2024 03:38 AM
Hi @Carol2 ,
The above code which I provided was of Record Producer script which is server side.
In UI policy you have to use client side code that is the reason why it is not working.
Try to set that up in producer script as below:
if(producer.u_caller == 'sysid_of_user1' || producer.u_caller == 'sysid_of_user2' || producer.u_caller == 'sysid_of_user3'){
var add_mail = "cc@joe.com";
var emailArrList = [];
emailArrList.push(add_mail);
current.watch_list = emailArrList.join();
}
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 05:11 AM
Hi @Carol2 ,
Please try the below:
var add_mail = " cc@joe.com";
var emailArrList = [];
emailArrList.push(add_mail);
current.watch_list = emailArrList.join();
Result:
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 05:23 AM - edited 07-25-2024 05:23 AM
Hello @Carol2 ,
Please try below code.
var add_mail = " cc@joe.com";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 05:30 AM
Thank you @SN_Learn this works. if i want to add "if a user from the mailing list submits a record then add cc@joe.com" to the watch list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 06:53 AM
Hi @Carol2 ,
Could you please provide some more details, is the mailing list a variable in record producer?
Mark this as Helpful / Accept the Solution if this helps.