record producer hard code an email address to the watchlist

Carol2
Tera Contributor

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;

 
Regards 
C.
1 ACCEPTED SOLUTION

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.

View solution in original post

10 REPLIES 10

SN_Learn
Kilo Patron
Kilo Patron

Hi @Carol2 ,

 

Please try the below:

var add_mail = " cc@joe.com"; 

var emailArrList = [];
emailArrList.push(add_mail);

current.watch_list = emailArrList.join();

 

Result:

SN_Learn_0-1721909468073.png

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

VaishnaviShinde
Kilo Sage

Hello @Carol2 ,

 

Please try below code.

 

var add_mail = " cc@joe.com"

current.watch_list = current.watch_list + ',' + add_mail;
 
If my response helped you, please mark it as accepted solution and helpful.

Carol2
Tera Contributor

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.

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.