SCTASK state changes to Closed Skipped

Chiranjeevi K
Tera Expert

I have a requirement whenever the SCTASK state changes to "Closed Skipped" it should restrict the user to save or update the record by showing the message to opt for the specific option only among 3 available options in the variable of the SCTASK form 

Could someone help with the approach, Thanks in the advance..!!


1 ACCEPTED SOLUTION

Chiranjeevi K
Tera Expert

I myself tried this with BR- Before update and it is working as expected please find the below
(function executeRule(current, previous /*null when async*/ ) {
// var Message = 'Please fill the mandatory variable "User Type" on the SCTASK form';
// var message1 = Message.fontcolor("red");
if (current.variables.user_type != "Not Required") {
gs.addErrorMessage(' ');
current.setAbortAction(true);
}
})(current, previous);

View solution in original post

1 REPLY 1

Chiranjeevi K
Tera Expert

I myself tried this with BR- Before update and it is working as expected please find the below
(function executeRule(current, previous /*null when async*/ ) {
// var Message = 'Please fill the mandatory variable "User Type" on the SCTASK form';
// var message1 = Message.fontcolor("red");
if (current.variables.user_type != "Not Required") {
gs.addErrorMessage(' ');
current.setAbortAction(true);
}
})(current, previous);