Creating n saving a doc while saving from Current DB

In querysave/postsave event, I am trying to create another doc in a remote DB.I debuged it. It has all the items and can access the remote DB(Default editor) as well but can’t save it. I also traced the save method and shows successful but its not.

Sub Postsave(Source As Notesuidocument)

Set ContactDoc = ContactDb.CreateDocument ContactDoc.Form = “Person”

ContactDoc.LastName = Source.FieldGetText( “LastName_tx” )

ContactDoc.Firstname = Source.FieldGetText( “FirstName_tx”)

Call ContactDoc.save(False,False)

End Sub

I even viewed all docs in the remote DB but no sign of it.

Thanks in advance

Subject: creating n saving a doc while saving from Current DB

You could try setting the first parameter of the Save-command to True.

And did you check the ACL of the ContactDb?

Subject: RE: creating n saving a doc while saving from Current DB

Yah I changed it to True & in ACL of Contact DB Default is Editor with all rights ticked.All Roles ticked as well.Still no hope.

That ContactDb has been created on Address Book template.

Thanks

Subject: RE: creating n saving a doc while saving from Current DB

I cannot see any apparant errors in what you are doing.

I had a look in the design of the NAB and could not find anything that could prevent you creating a Person.

You could try to make a new blank db and copy the Person form from the NAB into it. And check if that works. You will also need to include the shared actions from the NAB into this new db.

Subject: Solved: creating n saving a doc while saving from Current DB

I’ve modified the code as followingDim success As Variant

Set ContactDoc = ContactDb.CreateDocument

	ContactDoc.Form = "Person"

	ContactDoc.Type="Person"

	ContactDoc.LastName = Source.FieldGetText( "LastName_tx" ) 

	ContactDoc.Firstname = Source.FieldGetText( "FirstName_tx")

success = ContactDoc.ComputeWithForm( False, False )

	If success Then

		Call ContactDoc.save(True,False)

	End If