testing for existing task?

M

Matthias Crowe

Hi there!
I'm working on a syncronisation between project and another system.
The problem I have is to test wether a task exist or not. And that only with
the field "name".
Is it possible? And when: how?

Another question:
I recieve an error while using this code:

Call oProject.Parent.setMatchingField("Finish", oTask.getProjectEnd, "Name",
oTask.getID)
Call oProject.Parent.setMatchingField("Start", oTask.getProjectStart,
"Name", oTask.getID)
Call oProject.Parent.setMatchingField("Resourcenames",
oTask.getProjectResponse, "Name", oTask.getID)
Call oProject.Parent.setMatchingField("Duration", oTask.getProjectDuration,
"Name", oTask.getID)

oTask in my own object which contains the name, start, finish, resourcename
and the duration.
the first two lines: no problem, but in the third line (setting the
resourcenames) I get the error.
If I delete the problem line, the code works. Does anyone know why and would
tell me?

Thanks for all ideas and replies.

Greetings
Matthias
 
J

Jan De Messemaeker

Hi,

I run through the tasks with a for each loop and compare the name
HTH
 
M

Mark Durrenberger

Another thought.
If you put the Project Unique ID in your other database, you can test on
UID...

Mark


--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is that failure
comes as a complete surprise and is not preceded by
a period of worry and depression.

- Sir John Harvey-Jones
 
E

Earl Lewis

Matthias,

Testing for a match on name is very risky and will likely lead to problems unless you know with a high degree of certainty that no two projects will ever have the same name in a task. Or for that matter that no one project ever repeats the name for a task - under different outline levels for instance. What about "Training" for example? I could see this appearing several times in one plan as well as repeating across plans.

Bottom line - try to use the UID as suggested by Mark.

Earl
Hi there!
I'm working on a syncronisation between project and another system.
The problem I have is to test wether a task exist or not. And that only with
the field "name".
Is it possible? And when: how?

Another question:
I recieve an error while using this code:

Call oProject.Parent.setMatchingField("Finish", oTask.getProjectEnd, "Name",
oTask.getID)
Call oProject.Parent.setMatchingField("Start", oTask.getProjectStart,
"Name", oTask.getID)
Call oProject.Parent.setMatchingField("Resourcenames",
oTask.getProjectResponse, "Name", oTask.getID)
Call oProject.Parent.setMatchingField("Duration", oTask.getProjectDuration,
"Name", oTask.getID)

oTask in my own object which contains the name, start, finish, resourcename
and the duration.
the first two lines: no problem, but in the third line (setting the
resourcenames) I get the error.
If I delete the problem line, the code works. Does anyone know why and would
tell me?

Thanks for all ideas and replies.

Greetings
Matthias
 
E

Earl Lewis

Matthias,

On your other question: what is oTask.getProjectResponse doing in your third call? Is this a custom method of your oTask object? If so, I would look at it and make sure that it's doing what it's supposed to and returning the string you want.

Also, I think the field name you want is "Resource Names" not "Resourcenames".

Hope that helps.

Earl
Hi there!
I'm working on a syncronisation between project and another system.
The problem I have is to test wether a task exist or not. And that only with
the field "name".
Is it possible? And when: how?

Another question:
I recieve an error while using this code:

Call oProject.Parent.setMatchingField("Finish", oTask.getProjectEnd, "Name",
oTask.getID)
Call oProject.Parent.setMatchingField("Start", oTask.getProjectStart,
"Name", oTask.getID)
Call oProject.Parent.setMatchingField("Resourcenames",
oTask.getProjectResponse, "Name", oTask.getID)
Call oProject.Parent.setMatchingField("Duration", oTask.getProjectDuration,
"Name", oTask.getID)

oTask in my own object which contains the name, start, finish, resourcename
and the duration.
the first two lines: no problem, but in the third line (setting the
resourcenames) I get the error.
If I delete the problem line, the code works. Does anyone know why and would
tell me?

Thanks for all ideas and replies.

Greetings
Matthias
 

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