Re-Using Unique IDs

J

JJ

Here's the scenario:

1) Business rules dictate that the Unique ID of a task is the
identifier for systems outside of MS Project.
2) A task is deleted by accident 2 months ago.
3) A new task is established that is a copy of the deleted task.

Question: Is it possible to set the Unique ID of the new task to the
Unique ID of the deleted task?

My initial response would be "No". I don't think there is an "easy"
way. However, a more rigorous way would be to take the current file
and (via code) re-build it into a blank file in the order of the
Unique IDs. One would have to figure in Unique IDs that are skipped
and place the new task in the place where the deleted task was within
the Unique ID order.

If there is an easier way than the one that I mentioned above, please
let me know. That seems like a lot of work to "change" the Unique ID
of one task. Granted... multiple task could have been deleted as well.

Thanks in advance!
JJ
 
R

Rod Gill

Unique ID's cannot be changed so you're out of luck. however, for one
customer we used a Number field for the unique ID. Into that number field we
copied the Unique ID so if someone did cut/paste the Number field survived.
For your situation the Unique ID can be manually edited. I did this with VBA
of course, but manually copying is not hard.

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




JJ said:
Here's the scenario:

1) Business rules dictate that the Unique ID of a task is the
identifier for systems outside of MS Project.
2) A task is deleted by accident 2 months ago.
3) A new task is established that is a copy of the deleted task.

Question: Is it possible to set the Unique ID of the new task to the
Unique ID of the deleted task?

My initial response would be "No". I don't think there is an "easy"
way. However, a more rigorous way would be to take the current file
and (via code) re-build it into a blank file in the order of the
Unique IDs. One would have to figure in Unique IDs that are skipped
and place the new task in the place where the deleted task was within
the Unique ID order.

If there is an easier way than the one that I mentioned above, please
let me know. That seems like a lot of work to "change" the Unique ID
of one task. Granted... multiple task could have been deleted as well.

Thanks in advance!
JJ

__________ Information from ESET Smart Security, version of virus
signature database 5148 (20100526) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 5148 (20100526) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
J

John

JJ said:
Here's the scenario:

1) Business rules dictate that the Unique ID of a task is the
identifier for systems outside of MS Project.
2) A task is deleted by accident 2 months ago.
3) A new task is established that is a copy of the deleted task.

Question: Is it possible to set the Unique ID of the new task to the
Unique ID of the deleted task?

My initial response would be "No". I don't think there is an "easy"
way. However, a more rigorous way would be to take the current file
and (via code) re-build it into a blank file in the order of the
Unique IDs. One would have to figure in Unique IDs that are skipped
and place the new task in the place where the deleted task was within
the Unique ID order.

If there is an easier way than the one that I mentioned above, please
let me know. That seems like a lot of work to "change" the Unique ID
of one task. Granted... multiple task could have been deleted as well.

Thanks in advance!
JJ

JJ,
You are correct, the basic answer is "no". As I recall if the last task
added to a project is deleted and then a new task entered, the new task
will take the unique ID of the deleted task. But even so, that's not
going to help you.

I understand your problem with having to integrate Project with other
applications. Here are a couple of suggestions off the top of my head.
Neither requires any VBA.

If you can retrieve a archived copy of the file before the task was
deleted, it would take a bit of work but you could then update the file
from that point to the present.

Here's something else you could try but I haven't actually tried it so I
don't know if it has pitfalls.
1. Copy the ID field to a spare number field.
2. Sort the file by the Unique ID field.
3. Permanently renumber the file (i.e. normal ID field).
4. Insert the deleted line(s) in the desired location(s)
5. Now add in however many placeholder tasks it takes to fill up blanks
in the unique ID sequence. Flag them for easy deletion later.
6. Go to our MVP website at, http://www.mvps.org/project/faqs.htm, and
take a look at FAQ 43 - Handling Project file corruption and/or bloat
7. Create your new file using method 4
8. Delete placeholder tasks that were flagged
9. Sort the file by the saved ID sequence from step 1
When you're done you should have what you need.

Good luck

John
Project MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top