If i change the unique ID, would notes re-use it?

I have a DB, where i use the Unique ID as an internal key.

Now, from time to time, i need to cut/paste the document to another database, to fix some things.

When i bring the doc back, the UID is diferent that the one on the key field.

For examplo, i create a doc, and i save the UID on the “key” field:

key = “1234”

uid = “1234”

after mobing the doc to another db, and back, i have:

key = “1234”

uid = “5678”

now, would notes reuse “1234” as a UID?

What happens if i change uid to key?

thanks, and happy new year.

Subject: If i change the unique ID, would notes re-use it?

when you refer to unique ID are you meaning the doc ID that notes gives the doc or some ID that you give it, programatically? The one that Notes assigns is based on the time/date so unless you set the clcok back I highly doubt it has any chance of being reused. If you are referring to some other unique ID, whether notes would reuse it would depend on how it’s generated and how/whether your app is coded to check for duplicates.

Subject: RE: If i change the unique ID, would notes re-use it?

yes, i’m refering to the “doc ID that notes gives the doc”.

So if it’s based on time, i could set it back to what it was, without any problem. Thanks.

Subject: RE: If i change the unique ID, would notes re-use it?

Luis

You don’t want to fiddle with time in Notes and Domino. The best way to really screw up is to set the server’s clock back. Forward works to some extent, but as soon as you replicate, setting the clock back is, well, umm, interesting (and very time consuming ;-).

As I said, don’t fiddle with those ID’s, there’s a lot more connected to them than you care to take into account. The update agent is the way to go.

P.

Subject: If i change the unique ID, would notes re-use it?

You are into the crown jewels of notes.

Forget changing the UNID.

I suggest that you create an agent that updates the original doc with the data of the changed copy. That’s much easier than it sounds, and avoids a number of problems you can run into when you try to change the UNID - it’s the Notes way to do that kind of thing.

For a good information on what the UNID, NoteID, etc. are, download the Notes API Toolkit (it’s free; search for “notes api toolkit” in IBM, and don’t select the workplace one) and read the appendix “Anatomy of a Note ID” in the user’s guide. Highly recommended.

P.

Subject: RE: If i change the unique ID, would notes re-use it?

thanks, i would.

Subject: If i change the unique ID, would notes re-use it?

If you are changing a UNID back to what it was there really should not be a problem. We distribute a product where we have create a document and define a predetermined UNID so that we can always get the same document back in our code using the UNID. As we always use the same UNID and it is one that Notes created itself, and we have never had any problems, and if you do and it messes things up don’t call me. But, changing it back to the original UNID should work.