March 2017
Beginner
358 pages
9h 51m
English
Here, we check a user preference to see whether they have annotations turned on. If they do, we show an additional message on the screen:
var currentUser = gs.getUser(); if (currentUser.getPreference('glide.ui.show_annotations') === 'true') { gs.addInfoessage('This form is for [purpose]. You can do [instructions].'); }
Next, we have a business rule that we can imagine runs on the sys_user table, and checks a custom field, u_show_annotations. When this field is toggled off, this business rule sets the user's preference the same way:
var currentUser = gs.getUser(); if (current.u_show_annotations.changesTo('false')) { currentUser.savePreference('glide.ui.show_annotations', 'false'); }
Read now
Unlock full access