Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Sentry preference example

In this article

    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

    enPLHardDefault1hard-coded default, owner_id == 0
    enPLSystemWide2whole installation, all levels, owner_id == 0
    enPLDatabase3valid for all users of this database, owner_id = travelcurrent.current_id
    enPLGroup4valid for all users that are members of this group, owner_id = UserGroup.Id
    enPLIndividual5valid for this associate only, owner_id =
    enPLPC6valid for this local PC only, stored in registry HKLM\Software\SuperOffice