testing :: copy it out from CAS during save

Aug 18th, 2006No Comments

testing :: copy it out from CAS during save and copy back during open

QueryOpen
======================================================
Dim testRTF As Variant
Set testRTF = doc.GetFirstItem(“C_AckAttach”)
If (testRTF.type = RICHTEXT) Then
Call testRTF.Remove
End If
Set testRTF = New NotesRichTextItem(doc, “C_AckAttach”)
Dim rti As NotesRichTextItem
Set rti = doc.GetFirstItem(“testRTF2″)
Call testRTF.appendRTItem(rti)========================================================

agent for saving doc
========================================================
‘ TEST by HP 1808
Dim rti As Variant
Set rti = doc.GetFirstItem(“testRTF2″)
If (rti.type = RICHTEXT) Then
Call rti.remove
End If
Set rti = New NotesRichTextItem(doc, “testRTF2″)

Dim rticas As NotesRichTextItem ‘create new rti for testRTF2
Set rticas = doc.getFirstItem(“C_AckAttach”)
Call rti.appendRTItem(rticas)
‘ end test

document save

Aug 17th, 2006No Comments

Saving the documet at 1st time, data is still keep on the uidoc instead of doc. Thus, need to check it is newdoc and call uidoc.save ……


Call uidoc.Refresh
If doc.isnewnote Then
Call uidoc.Save
Else
Call doc.save(True, True)
End If
Call uidoc.Close

controlled access section

Aug 16th, 2006No Comments

In a controlled access section, in order to have access you must be listed in the list of names that has access to that section. The list of names can be hard-coded or computed, but it must be a list of names. So what if you have access to your database controlled through roles and would like to do the same for the section?Well, you will have to have your formula compute a list of names and then if you, personally, are a member of that list of names then you will have access. That “list” of names could really just be one name. In order to get that one name, use the following formula in your controlled access section:

@If(@IsMember(“[RoleName]“; @UserRoles); @UserName; “Nobody”)
Note: “[RoleName]“ should be substituted with the name of your role. “Nobody” is any string except the user’s name.This will see if the user currently opening the document is a member of the given role. If they are, the controlled section access “list” of editors is the current user. The current user (obviously) matches the current user and they have access to the section. If they are not in the role, the controlly section access “list” is the string “Nobody” which doesn’t match the current user (we hope) and prevents access to the section.