Assignment.TaskUniqueID <> Task.UniqueID

L

LT

I've noticed that Assignment.TaskUniqueID bahaves differently depending on
whether the code is running in an MPP file of in a check-out Project Server
project.

In an MPP file, Assignment.TaskUniqueID works as advertised. I can find the
corresponding Task.UniqueID for each Assignment.TaskUniqueID.

However, in a check-out Project Server project, when I retrieved the
Assignment.TaskUniqueID, I can NOT find the corresponding Task.UniqueID.
What's interesting is that most of the Task.UniqueID's are 4-digit numbers
such as 7056, but most of the Assignment.TaskUniqueID's are 7-digit numbers
such as 8395702.

Does anyone knows why Project is behaving this way?
 
J

JackD

When you have inserted projects (such as in the case of a master project)
project adds a "magic number" to the UID so that it doesn't have duplicates.
The magic number is a multiple of 2 to the 22nd power so it is typically
4194304 or 8388608 or 12582912 or ...

It is trival to determine the "real" UID by using the MOD operator. (see
more about MOD here:
http://zo-d.com/blog/archives/programming/vba_-_integer_division_and_mod.html)
In this case you would do something like this.

realUID = Task.UniqueID MOD 4194304
 
L

LT

Thank you. You definitely know your Project!

JackD said:
When you have inserted projects (such as in the case of a master project)
project adds a "magic number" to the UID so that it doesn't have duplicates.
The magic number is a multiple of 2 to the 22nd power so it is typically
4194304 or 8388608 or 12582912 or ...

It is trival to determine the "real" UID by using the MOD operator. (see
more about MOD here:
http://zo-d.com/blog/archives/programming/vba_-_integer_division_and_mod.html)
In this case you would do something like this.

realUID = Task.UniqueID MOD 4194304
 
J

JackD

No problem. It is all a matter of working with it. Sooner or later it starts
to make sense.
 
D

Daniel

Hi,

Thanks, I needed the same information. However, I also need to find out how
this Task.UniqueID is created. So you have something like:

realUID + (4194304 * A) = Task.UniqueID

Any idea where I can find this A ?
 

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