March 2017
Beginner
358 pages
9h 51m
English
Here, imagine we have a record where the active field is set to false because the ticket has been closed for some time. Normally, there would be an ACL or data policy in place to prevent users from reopening such tickets if we didn't want them to, but imagine that in this case, we have no such thing. Instead, we're using a business rule to make that determination, because a business rule can be scripted and use more complex logic:
if (current.active.changesFrom(false) && !gs.hasRole('admin')) { gs.addErrorMessage('Non-admins cannot re-open closed tickets after they've been deactivated.'); current.setAbortAction(true); }
As you can see in the preceding example, this script checks two conditions: The active field changes ...
Read now
Unlock full access