Check or uncheck box based on other fields
Hi, Sorry I am a noob
I have a situation like this

If a work is deemed to be VH or H (Very high or High) Risks, the employee is not allowed to work after hours.
So I want the checkbox "Not allowed" to be checked when R (Risk) is displayed as VH or H and lock the "Allowed" and "Monitor Only" checkboxes.
So far this is what I have done but it does not seem to perform what I expected:
1) Set up a JavaScript under Actions

2) The following script in the "Not Allowed" checkbox
var R = this.getField("Risk").valueAsString;
if(R=="H"||R=="VH"){event.value = "Yes";}
