Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

How many users opened one incident and how get users list

Ajay gadudasu
Tera Contributor

How many users opened one incident and how get users list

2 REPLIES 2

Not applicable

Amit Pandey
Mega Sage

Hi @Ajay gadudasu 

 

You can create a list field on the form and use display business rule to save those users in the list. An outline of the Display BR is as follows-

 

(function executeRule(current, previous /*null when async*/ ) {
if (current.isNewRecord())
return;
var currentUser = gs.getUser().getID();
var oldusers;

oldusers = current.u_incident_viewers; //List field to store 
var user = oldusers.split(',');

var i;
for (i = 0; i < user.length; i++) {
var old = user[i];
if (old == currentUser) {
return;
}
}
current.u_list_viewers += ',' + currentUser;
current.update();

})(current, previous);

Please mark my answer helpful and correct.

 

Regards,

Amit