I’m hoping to be able to remove the ‘no refresh’ flag (which I’ve used for testing) from a batch of my user’s Calendar Profile documents.
I’m using coding (from a view) which seems to work, in getting the Calendar Profile fields, EXCEPT that it doesn’t grab a value for $Flags.
In Debug mode, the $Flags field doesn’t even appear in the Items list.
The field $Flags is on the Design of the Calendar Profile, but it doesn’t seem to be on the actual documents (using NotesPeek)
Can anyone help?
Coding below, thanks
Marcia
Sub Click(Source As Button)
Dim s As New NotesSession
Dim db As NotesDatabase
Dim col As NotesDocumentCollection
Dim doc As notesdocument
Dim Pdoc As NotesDocument
Dim flags As String
Set db = s.CurrentDatabase
Set col = db.UnprocessedDocuments
Set doc = col.GetFirstDocument
While Not doc Is Nothing
Set mailDB =New NotesDatabase(doc.MailServer(0), doc.MailFile(0))
Set Pdoc = mailDB.GetProfileDocument("CalendarProfile" )
If Pdoc.hasitem("$Flags") Then
flags = Pdoc.getitemvalue("$Flags")(0)
If Instr(flags , "P") >0 Then
'remove the P
flags2=Replace(flags,P,"" )
Call Pdoc.replaceitemvalue("$Flags", flags2 )
Call Pdoc.save(True,False)
End If
End If
Set doc=col.getnextdocument(doc)
Wend
Subject: RE: Calendar Profile - can’t get $Flags field
If you want to modify the design inheritance property of the Caledndar Profile form for some reason, can’t you just do this through Designer? Alternatively, you can get at the Design note using its Universal ID and then operate on it like a “normal” document in which the fields are not read-only.
Subject: RE: Calendar Profile - can’t get $Flags field
I’ll try that, thanks!The reason I’m not keen to re-set these individually, using Designer, is that I’m using a few hundred mailfiles as our ‘test group’ for my changes, and it would be handy to be able to do this in bulk.
Subject: RE: Calendar Profile - can’t get $Flags field
OK, you did set the "Prohibit design … " option in the template and propagated it to all mail file’s design? So, you need an agent, that runs against all user’s mail files and changes the design note (not the profile document) back to not to prohibit design replacement.
Getting access to the design note via Unique ID is not an option, because this is different for each database. But you can get access to design notes using the NotesNoteCollection object.
is an example on how to do it for agents. You can easily modify it to select forms instead of agents and then - if necessary - loop through all forms until you find the calendar profile form.