MakeResponse problem

Hi

I am copying documents from one database to another. Once copied I would like to make the new documents response documents but am getting the following error:

Notes error: You are not authorized to perform that operation

I have manager access to the database and can create documents by hand. Here is the code I am using to create documents:

---------------- start of code

’ now get the document

Set clientDoc = clientDB.GetDocumentByUNID (doc.scu_DOC_UID (0))

If clientDoc Is Nothing Then Goto nextDoc

’ now create a new document

Set newDoc = New NotesDocument (clientDB)

If newDoc Is Nothing Then Goto nextDoc

newDoc.form = “fmAppointment”

Call newDoc.Save (True, False) ’ added this to make sure I can create documents in the DB

Call newDoc.MakeResponse (clientDoc) ’ get error 4000 here “not authorized”

---------------- end of code

I use the exact same code to create documents in another database and it works perfectly. I have added myself explicitly in the ACL of each db. I am using OpenLog and am getting my user in the User / Effective name fields. The Access Level is Manager!

Anybody have an idea what is going on here?

Thanking you in advance for any info

Ursus

Subject: Is frmAppointment a response form in the new DB?

Subject: RE: Is frmAppointment a response form in the new DB?

Hi Bill

thank you for you quick response.

Yes, the form is a response form (response to response). I can also create the document by hand - the problem is when I run the agent (still as the same user) I get the error. This is basically what is bugging me - if I got the error when doing it by hand I would know that I have an ACL problem.

Any other ideas?

ursus

Subject: RE: Is frmAppointment a response form in the new DB?

Make sure you have explicitly dim’d the response and parent docs as documents.

dim pdoc as notesdocument

dim rdoc as notesdocument

regards,

raphael

Subject: RE: Is frmAppointment a response form in the new DB?

Hi Raphael

thank you for your answer

Yes, I have explicitly dim’ed the documents. The code works with a second database which is weird. I was wondering if the ACL is broken - maybe I should delete it and recreate?

Useus

Subject: RE: Is frmAppointment a response form in the new DB?

If it was a problem with the ACL you should get the error when you save the document not when you try to make it a response. This also needs to be the other way around - make it a response and then save it.

I notice you are getting the document from an id stored in a field using doc.scu_DOC_UID (0). When you copy it over the new document will have a different unique id. Could it be that clientdoc is pointing to the document in your other database?