I don’t do much Notes development these days but every now and then it happens. The last few days I’ve been spending some time with Notes doing a few modifications to a client’s system and came across these two problems:
The client emailed me two Notes database but forgot to uncheck “Enforce a consistent Access Control List”.
Back in the good old days, I’m talking Notes R4 and earlier, you used to have full access to any database that you accessed locally, i.e. a database that was stored or replicated to your local machine. I don’t know what the design reasons for this might have been, but one major drawback of course was that you couldn’t restrict what a user could and could not do as efficiently on a local replica as you could if the application resided on a server. Also Roles did not work locally. Anyway, this all changed in some R4 sub release when the Enforce a consistent ACL was introduced. But now you’ve got a problem whenever you as a developer need access to a database and you’re not in the ACL.
So usually there are two ways around this:
– If there is a manager group in the ACL, create this group in your local address book and add yourself.
– Ask the client to send you a new copy of the database where Enforce a consistent ACL is unchecked.
Today neither of these were an option and I was on a deadline so I Googled to see if there was a solution somewhere. At Ben Poole’s blog I found a third solution. Ben has written some code that uses the Notes API to uncheck Enforce a consistent ACL for you on a local database, no matter what your access rights are.
Simply download the code from Ben’s blog and copy and paste it to a button on a Notes form. Then call the removeEnforce function with the full path and filename of the database as argument.
For me the checkbox got unchecked but for some reason I still didn’t have full access to the ACL so I had to restart Notes and then it worked fine. According to Ben this script should do the trick for both Notes R5 and R6. Myself I used it in R7.
Ok, so with that done time for next problem: I was simply changing what default view should be opened to the user in a frameset (Notes client, no web). The old view worked fine but when I changed to the new one I got one of Notes many informative error messages: “Cannot execute the specified command.”
After doing some troubleshooting I found out that the problem was that I did a @Command([ViewCollapseAll]) in the views PostOpen event. So I searched Notes.net/LDD/Developerworks (I don’t even know what they call it anymore) and I found this thread that didn’t explain why but at least provided a work around. Adding @Command([OpenView];@ThisName) worked for me in Notes 7.0
@Command([OpenView]; @ThisName );
@ThisName is new in
R7 R6 [corrected] so to get this to work in previous versions you need to provide the view name as a common string (see the Notes.net thread).