Example 1
Field level sentry - make the department field read only. You may copy and save the code below as *.vbs. The number 5 at the end refers to preference level.
set soApp = CreateObject("superoffice.application")
soApp.database.preferences.set "Rights-contact-Existing", "contact.department", "1, The department field is read-only on all existing contacts", 5
MsgBox "Read only preference added for logged in user: " & soApp.Database.UserName
Example 2
Table sentry - remove update rights on existing projects. You may copy and save the code below as *.vbs
set soApp = CreateObject("superoffice.application")
soApp.database.preferences.set "Rights-project-Existing", "Table", "17, You may not change existing projects", 5
MsgBox "Read only preference to projects added for logged in user: " & soApp.Database.UserName
Different preference level
Member | Value | Description |
---|
enPLUndefined | 0 | Undefined |
enPLHardDefault | 1 | hard-coded default, owner_id == 0 |
enPLSystemWide | 2 | whole installation, all levels, owner_id == 0 |
enPLDatabase | 3 | valid for all users of this database, owner_id = travelcurrent.current_id |
enPLGroup | 4 | valid for all users that are members of this group, owner_id = UserGroup.Id |
enPLIndividual | 5 | valid for this associate only, owner_id = associate.id |
enPLPC | 6 | valid for this local PC only, stored in registry HKLM\Software\SuperOffice |