T
Tiffy Huxtable
Hello,
I have massive trouble with inserting/adding a new task between two
existing tasks programmatically via Project Webservice (not VBA).
Two examples, one working and one not working, shall explain what the
problem is.
Example 1)
Given is the following project plan in Project Professional:
Task 1
Task 2
Two lines, nothing more.
Adding programmatically via Project Webservice a third task "Task 3"
between the two existing tasks works, so the result project plan is:
Task 1
Task 3
Task 2
Example 2:
Task 1
<empty line>
Task 2
Yes, you can insert empty lines in Project Professional. Those 3 lines
are now viewable in the project plan. Now when I try to insert a new
task "Task 3" then the insertion fails with
"TaskUnableToInsert" (id=7025) and the queued job is blocked in the
queue.
The SharePoint log offers lots of entries, one is:
10/13/2009 14:42:14.95 Microsoft.Office.Project.Server (0x13C8)
0x173C Project Server Project Server-side Project Ope
8syo Medium PWA:http://sample.test.local/PWA, SSP:SharedServices1,
User:TEST\superadmin, PSI: SSP: HandleTaskInserts exception
System.InvalidCastException: Specified cast is not valid. at
Microsoft.Office.Project.Server.BusinessLayer.ProjectOutline.HandleTaskInserts
(ProjectDataSet dataset, Guid projectUid, Hashtable tasksToInsert,
Boolean isUpdate) 4cfd0822-6602-4bb6-8a05-553fd54da20d
After lots of time and tries I found out that the empy line is the
reason why it fails. MSDN says that in order to insert a new task
between existing tasks I have to assign the TASK_UID of the task after
that I want to insert.
In my example TASK_UID of "Task 1" is relevant and is assigned to the
"AddAfterTaskUID" property of my new task "Task 3".
So, inserting a new task between existing tasks programmatically via
PSI Project Webservice works as long as there are no empty lines. But
when there are empty lines like in my example then the insertion via
PSI fails.
Any suggestions or workarounds to this problem?
TIA and best regards, Tiffy
I have massive trouble with inserting/adding a new task between two
existing tasks programmatically via Project Webservice (not VBA).
Two examples, one working and one not working, shall explain what the
problem is.
Example 1)
Given is the following project plan in Project Professional:
Task 1
Task 2
Two lines, nothing more.
Adding programmatically via Project Webservice a third task "Task 3"
between the two existing tasks works, so the result project plan is:
Task 1
Task 3
Task 2
Example 2:
Task 1
<empty line>
Task 2
Yes, you can insert empty lines in Project Professional. Those 3 lines
are now viewable in the project plan. Now when I try to insert a new
task "Task 3" then the insertion fails with
"TaskUnableToInsert" (id=7025) and the queued job is blocked in the
queue.
The SharePoint log offers lots of entries, one is:
10/13/2009 14:42:14.95 Microsoft.Office.Project.Server (0x13C8)
0x173C Project Server Project Server-side Project Ope
8syo Medium PWA:http://sample.test.local/PWA, SSP:SharedServices1,
User:TEST\superadmin, PSI: SSP: HandleTaskInserts exception
System.InvalidCastException: Specified cast is not valid. at
Microsoft.Office.Project.Server.BusinessLayer.ProjectOutline.HandleTaskInserts
(ProjectDataSet dataset, Guid projectUid, Hashtable tasksToInsert,
Boolean isUpdate) 4cfd0822-6602-4bb6-8a05-553fd54da20d
After lots of time and tries I found out that the empy line is the
reason why it fails. MSDN says that in order to insert a new task
between existing tasks I have to assign the TASK_UID of the task after
that I want to insert.
In my example TASK_UID of "Task 1" is relevant and is assigned to the
"AddAfterTaskUID" property of my new task "Task 3".
So, inserting a new task between existing tasks programmatically via
PSI Project Webservice works as long as there are no empty lines. But
when there are empty lines like in my example then the insertion via
PSI fails.
Any suggestions or workarounds to this problem?
TIA and best regards, Tiffy