This gets filed under the “I am writing this because I know I am going to forget it, and will need it again”
We had a problem in a database whereby we were checking to see if document locking was enabled and if not then it gets programmatically enabled.
This reference document from IBM tells you how it can be done in LotusScript. This was done to the database which was deployed around the world.
Is there a way to programmatically change Database Properties for a database?
'Set the Allow document locking (LotusScript) Set docIcon = dbCurrent.GetDocumentByID("FFFF0010") If(InStr(1,docIcon.~$Flags(0),"5") = 0) then docIcon.~$Flags = docIcon.~$Flags(0) & 5 End If
So it turns out though that when you write flawed code this can get out of hand add one too many 5s
<item name=’$Flags’><text>fJz47IZ!?nR555555555555</text></item>
What this does is stops the database icon from being updated as it causes a design lock on the element – weird eh.
In Domino Designer in Eclipse (DDE) you can easily fix this through designer.
In the Domino Designer perspective – open Package Explorer and find resources IconNote. Within there you can see the DXL representation of the database properties and you can mess with them to your hearts content.
You can also get to it through the database properties
Disclaimer – Don’t mess with Database Properties, brick your database and call me – that’s all your own fault 🙂
Love the disclaimer! Pretty sure I’ve never heard a db referred to as “bricked”!
I am not quite sure why you are doing it that way in LotusScript – wouldn’t this make more sense:
‘ get a handle to the database
Dim session As New NotesSession ()
Dim db As NotesDatabase
Set db = session.CurrentDatabase
‘ check if allow document locking is enabled, if not enable it if you are an admin user
If not db.Isdocumentlockingenabled then
If adminUser Then ‘ <= this flag gets set elsewhere
db.Isdocumentlockingenabled = True
end if
end if
Not quite sure why you would mess with the database flags?
Ursus – thank you. That is great to know!!
The only thing I can say in my defense is that code was not originally mine – although I did not know about the setting either.
Thanks 🙂