The CreatorCon Call for Content is officially open! Get started here.

Doubt

seshik
Tera Contributor

how to restrict users from list view not to change state value using client script

 

1 ACCEPTED SOLUTION

Najmuddin Mohd
Mega Sage

Hi @seshik 

You need to write an on-cell edit client script.

 

Example:

function onCellEdit(sysIDs, table, oldValues, newValue, callback){
var saveAndClose = true;
if(newValue != oldValues) { 
alert("Changing state from list is not allowed.");
saveAndClose = false;
}
callback(saveAndClose);
}


Another Best approach be to write an WRITE ACL on table.state field. 
Only those users with that role can edit and for it will be read only.

If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmudin.

View solution in original post

1 REPLY 1

Najmuddin Mohd
Mega Sage

Hi @seshik 

You need to write an on-cell edit client script.

 

Example:

function onCellEdit(sysIDs, table, oldValues, newValue, callback){
var saveAndClose = true;
if(newValue != oldValues) { 
alert("Changing state from list is not allowed.");
saveAndClose = false;
}
callback(saveAndClose);
}


Another Best approach be to write an WRITE ACL on table.state field. 
Only those users with that role can edit and for it will be read only.

If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmudin.