Subject: RE: Blackberry and address book sync
Thanks Bob, I should post my code.
Below is the code that is actually creating the document.
I found that the$Revisions field would be replaced with $UpdatedBy if I only saved it once. By Setting the $Revisions field twice and saving twice I end up with both fields.
This gets a bit repetitive.
Sub CopyRolodex
Set destnote=destdb.createdocument
Set item = sourcenote.GetFirstItem("Firstname")
Call item.copyitemtodocument(destnote, "Firstname")
Set item = sourcenote.GetFirstItem("MiddleInitial")
Call item.copyitemtodocument(destnote, "MiddleInitial")
Set item = sourcenote.GetFirstItem("Lastname")
Call item.copyitemtodocument(destnote, "Lastname")
Set item = sourcenote.GetFirstItem("MailAddress")
Call item.copyitemtodocument(destnote, "MailAddress")
Set item = sourcenote.GetFirstItem("JobTitle")
Call item.copyitemtodocument(destnote, "JobTitle")
Set item = sourcenote.GetFirstItem("CompanyName")
Call item.copyitemtodocument(destnote, "CompanyName")
Set item = sourcenote.GetFirstItem("Lastname")
Call item.copyitemtodocument(destnote, "Lastname")
Set item = sourcenote.GetFirstItem("StreetAddress_Pr_Bu")
Call item.copyitemtodocument(destnote, "OfficeStreetAddress")
Set item = sourcenote.GetFirstItem("City_pr_bu")
Call item.copyitemtodocument(destnote, "OfficeCity")
Set item = sourcenote.GetFirstItem("State_pr_bu")
Call item.copyitemtodocument(destnote, "OfficeState")
Set item = sourcenote.GetFirstItem("Zip_pr_bu")
Call item.copyitemtodocument(destnote, "OfficeZip")
Set item = sourcenote.GetFirstItem("Country_pr_bu")
Call item.copyitemtodocument(destnote, "OfficeCountry")
Set item = sourcenote.GetFirstItem("OfficePhoneNumber")
Call item.copyitemtodocument(destnote, "OfficePhoneNumber")
Set item = sourcenote.GetFirstItem("OfficeFaxPhoneNumber")
Call item.copyitemtodocument(destnote, "OfficeFaxPhoneNumber")
Set item = sourcenote.GetFirstItem("CellPhoneNumber")
Call item.copyitemtodocument(destnote, "CellPhoneNumber")
Set item = sourcenote.GetFirstItem("StreetAddress")
Call item.copyitemtodocument(destnote, "StreetAddress")
Set item = sourcenote.GetFirstItem("City")
Call item.copyitemtodocument(destnote, "City")
Set item = sourcenote.GetFirstItem("State")
Call item.copyitemtodocument(destnote, "State")
Set item = sourcenote.GetFirstItem("Zip")
Call item.copyitemtodocument(destnote, "Zip")
Set item = sourcenote.GetFirstItem("Country")
Call item.copyitemtodocument(destnote, "Country")
Set item = sourcenote.GetFirstItem("PhoneNumber")
Call item.copyitemtodocument(destnote, "PhoneNumber")
Set item = sourcenote.GetFirstItem("HomeFaxPhoneNumber")
Call item.copyitemtodocument(destnote, "HomeFaxPhoneNumber")
Set item = sourcenote.GetFirstItem("Spouse")
Call item.copyitemtodocument(destnote, "Spouse")
Set item = sourcenote.GetFirstItem("Children")
Call item.copyitemtodocument(destnote, "Children")
Set item = sourcenote.GetFirstItem("FullName")
Call item.copyitemtodocument(destnote, "FullName")
destnote.Type="Person"
destnote.form="Contact"
Call destnote.ComputeWithForm( False, False )
Set item = New NotesItem(destnote, "$Revisions", Date)
item.IsSummary = True
Call destnote.save (True,False)
Set item = New NotesItem(destnote, "$ConflictAction", "1")
Set item = New NotesItem(destnote, "$ExternalFields", "1")
Set item = New NotesItem(destnote, "$Revisions", Date)
item.IsSummary = True
Set item = New NotesItem(destnote, "OriginalModTime", Date)
item.IsSummary = True
Call destnote.save (True,False)
End Sub