I had problems with various databases resetting their database launch properties to "restore as last viewed by user". Went onto Notes.net and saw that many were having same problem. Having put a pretty consistent appearance together on all databases and interfaces I have developed since the R5 upgrade, this drove me crazy....not to mention the fact that views often launch within framesets containing actions that are necessary to functional database use. Without the frameset, therefore, the database is sometimes unusable to the average end-users. I was tired of doing a daily browse through the properties tabs of multiple databases and resetting launch properties that no one could have changed, an R5 bug....and all the phone calls that went with it. This code did the trick.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
Place in the postopen of the database script. You can add as many conditions as you need, and must modify to suit your database. I'm using it with the database properties set to open the lower security, or default, frameset.
Sub Postopen(Source As Notesuidatabase) Dim ns As New NotesSession Dim workspace As New NotesUIWorkspace Dim ndb As NotesDatabase Dim nacl As NotesACL Dim naclEnter As NotesACLEntry Dim level As Integer Dim intFlag1 As Integer Dim intFlag2 As Integer Set ndb = source.Database Set nacl = ndb.ACL level = ndb.QueryAccess(ns.UserName) Set naclEnter = nacl.GetEntry( ns.UserName ) intFlag1 = naclEnter.IsRoleEnabled("<DesiredRole1>") intFlag2 = naclEnter.IsRoleEnabled("<OptionalAdditionalRole>") 'Check levels and roles, open frameset If level > 2 And (intFlag1 Or intFlag2) Then Call workspace.OpenFrameset("Administrator Frameset") Else Call workspace.OpenFrameset("Employee Frameset") End If End Sub