Hi All
I rolled out a new version of our internal RFC database two days ago, and so far all is well. I had one hitch which I managed to brute-force my way around, but I wondered if Notes was acting as it is supposed to?
Once of the features of the second version of the database was increased control over whop could edit documents. To achieve this, I downgraded the standard user group’s access level from Editor to Author. I also converted a couple of Names-type fields on the main RFC form to Authors-type, and added some more computed ones. This means that the allowable authors of a document are:
*The person who created it
*The person on whose behalf it has been created (if applicable)
*The team responsible for implementing the change
*The people named on the AppActGroup document “Service Delivery” and the default designer account.
All went well under testing.
When I finished rolling it out, I realised that there was a problem. Any RFCs that existed before the design change could not be edited by their creators. When I checked the document properties, the creator field was still shown as a Names field, rather than one controlling read/write access. Then I realised that in order to overcome this, the document would have to be recomputed with the form, do I wrote the following agent:
Sub Initialize
'2011-Jul-13
'Pick up the selected form(s) and recompute all of its(their) documents
Dim sess As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim docProf As NotesDocument
Dim docData As NotesDocument
Dim varForms As Variant
Dim strForms As String
Dim strFormula As String
Set db = sess.CurrentDatabase
Set docProf = db.GetProfileDocument("RFCProfile")
varForms = docProf.ProfFormRecalc
Set docProf = Nothing
Forall f In varForms
If strForms = "" Then
strForms = f
Else
strForms = strForms & {":"} & f
End If
End Forall
strFormula = {Form = "} & strForms & {" & !@IsResponseDoc}
Set dc = db.Search(strFormula, Nothing, 0)
Set docData = dc.GetFirstDocument
Do Until docData Is Nothing
Call docData.ComputeWithForm(False, False)
Call docData.Save(True, False, False)
Set docData = dc.GetNextDocument(docdata)
Loop
End Sub
[The named profile document field holds a list of form aliases. This enables me to re-run the agent without having to edit it each time.] To my surprise, this didn’t work. I did some digging, and tried a Formula agent instead, making use of @Command([ToolsRefreshAllDocs]). This also didn’t work. In desperation, I added the following declaration and statements:
Dim itmAuthField As NotesItem
Set itmAuthField = docData.GetFirstItem("RFCRaiser")
itmAuthField.IsAuthors = True
Set itmAuthField = docData.GetFirstItem("RFCRaisedFor")
itmAuthField.IsAuthors = True
The statements went above the ComputeWithForm statement. This worked - my colleagues had their author rights again!
My questions (if you’re still with me):
*Is my conclusion about the need to recalculate the documents in order to pick up new field types correct?
*If so, why didn’t ComputeWithForm affect the items’ types?
TIA!