We’re not on Kinetic yet, it’s a big leap from how Classic is customized. Are you sure you got the syntax correct? Could this be done as a Pre-process BPM on the save method? That’s where I put checking user groups as it’s a server function not a UI function.
@Randy is correct… the best place to put “business logic” is in a BPM rather than in the UI. You can put logic in the UI if necessary but it is often safer to do it in the BPM because then it is not dependant on which UI you are using. it relies instead on which business object (or data set if you use a data bpm) is active.