I've been doing this in an application I'm working on for a while. I have a profile form named Keyword_profile_frm. Instead of opening the profile form I open another form That I use to populate my Keywords, I have two fields on this form the "Key" field and the "KeyWordList" fields. I have a WQO and WQS agent on this form. The WQO acts the same as you've (Jake) has outlined. The only difference being that I use the CopyItem and ReplaceItemValue methods and I never have any caching issues!
e.g. (from WQS agent)
Set docProfile = curdb.GetProfileDocument ("Keyword_profile_frm")
keyname = currentPage.GetItemValue("key")(0)
Set keywordlist = currentPage.GetFirstItem("keywords")
Dim keyValue As NotesItem
Set keyValue = docProfile.GetFirstItem(keyname)
If keyValue Is Nothing Then
Call docProfile.CopyItem(keywordlist, keyname)
Set keyValue = docProfile.ReplaceItemValue(keyname,keywordlist)
Else
Call docProfile.CopyItem(keywordlist, keyname)
End If
Call docProfile.Save(True,False)
In saying that this is just used to update one profile doc with a set of key values but I can't see why i'm having no caching issues!
I've been doing this in an application I'm working on for a while. I have a profile form named Keyword_profile_frm. Instead of opening the profile form I open another form That I use to populate my Keywords, I have two fields on this form the "Key" field and the "KeyWordList" fields. I have a WQO and WQS agent on this form. The WQO acts the same as you've (Jake) has outlined. The only difference being that I use the CopyItem and ReplaceItemValue methods and I never have any caching issues!
e.g. (from WQS agent)
Set docProfile = curdb.GetProfileDocument ("Keyword_profile_frm")
keyname = currentPage.GetItemValue("key")(0)
Set keywordlist = currentPage.GetFirstItem("keywords")
Dim keyValue As NotesItem
Set keyValue = docProfile.GetFirstItem(keyname)
If keyValue Is Nothing Then
Call docProfile.CopyItem(keywordlist, keyname)
Set keyValue = docProfile.ReplaceItemValue(keyname,keywordlist)
Else
Call docProfile.CopyItem(keywordlist, keyname)
End If
Call docProfile.Save(True,False)
In saying that this is just used to update one profile doc with a set of key values but I can't see why i'm having no caching issues!