Thanks a lot for replying.
I'm definitely not following what's going on here. I can't make sense
of your explanation, so I'll just ask some questions to help get us on
the same page.
I wrote an application that exports data into msproject. Users can
also import data as well back into my app.
Import data from Project into your app, or from some other app?
The problem is keeping
track of the relationship between the msproject unique id and my
database's unique id. Right now, when a user exports into msproject,
my app modifies the "Number20" field to store the unique id that exists
in my app. I could not find a way to directly modify the unique id
field to put my db's unique id.
I don't know of anyway to change a Project UID. They're deliberately
fixed.
It isn't clear to me is whether or not you've created a lookup table in
your database with both sets of UIDs so that the macro can go there to
determine the Project UID from the db UID and vice versa. Do you have
such a table? If not, would it help?
The problem is that when a user copies/pastes a task in msproject, the
value in that field (Number20) is also copied. Therefore, I can't
re-import because the same number is there twice in msp. Even the
"Created" date field is copied when a user does a copy/paste in msp
which I find bizarre.
If Number20 is in the table that is copied, it will be copied. You can
create a table without Number20 in it if you don't want it copied, but
if you're importing it back into your database, you'd need it to
determine which task it is there. So why would you not want it copied
in the first place?
The "Created" date field will be copied if it's in the table. If you
don't want it to be copied, again, create a table without that value in
it.
I wrote a macro which copies and pastes and clears the field that
stores the unique id of my database but this is not a very solid
solution.
Which field does it clear? The one in Project (Number20) or the one in
your database? How does this help?
Therefore, blocking the ability to copy/paste would be the ideal
solution unless there is another way to maintain integrity between the
two databases which I haven't thought of.
This doesn't make sense to me. If you want your macro to be able to
copy/paste data into Project, and your users to be able to copy/paste
data from Project to your database, why would you want to block
copying/pasting? Wouldn't this defeat the whole purpose of your
external database if you can't exchange data between it and Project?
BTW, I'm brand new to MSP and don't know anything about its features.
And I know even less about databases, so I may not be of much help!