Document-locking and Conflicts

Hi there,we have server-based locking activated in an app. The user can use a button in an existing doc to “clone” it, i.e. copy some fields to a new document and edit this. The script goes like this:

…

set uidoc = ws.currentdoc

call method-that-copies-values-to-global-variables

call uidoc.close

dim newdoc as new notesdocument(db)

doc.form = …

doc.field1 = globvar1

doc.field2 = globvar2

[etc.]

set uidoc = ws.editdocument(true, doc, false)

What the user gets is a new uidoc with the values from the old doc. When he uses the “save”-button (@cmd([viewrefreshfields]) & @cmd([filesave])), the doc get visible in the view with “$Writers”-field filled with the users name. OK so far, but when the user uses the “save”-button a second time, he gets prompted whether he wants to save the doc as a replication-conflict.

Any hint or explanation will be greatly appreciated,

Buzzy

Subject: Document-locking and Conflicts

The code you posted has:set uidoc = ws.editdocument(true, doc, false)

shouldn’t that be:

set uidoc = ws.editdocument(true, newdoc, false)

I would guess that’s why the prompt is popping-up.

Leonardo

Subject: RE: Document-locking and Conflicts

Hi,sorry for that mistake. But the real mistake was that I wrote:

dim newdoc as new notesdocument(db)

It should be “dim doc.” instead…

Buzzy