Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error updating a project via PSI

328 views
Skip to first unread message

albupp

unread,
Jan 30, 2008, 4:59:01 PM1/30/08
to
Greetings Everyone,

I'm hoping that someone here might be able to help me understand a specific
error code I'm getting back from the PSI remote web service, namely:
GeneralOnlyUpdatesAllowed. I've searched the SDK docs, the web and this forum
for more information about this error code, but without learning much. The
SDK docs are terse, they simply say: "Only updates are allowed."

I'm simply trying to update the TASK_DUR column of a given task for a given
project. My code looks something like this:

ProjectDataSet prjDs = new ProjectDataSet();
ProjectDataSet.TaskRow task = prjDs.Task.NewTaskRow();
task.PROJ_UID = prjGuid;
task.TASK_UID = oldTask.TASK_UID();
task.TASK_DUR_FMT = (int)Enum.Parse(typeof(PSLib.Task.DurationFormat),
"Hour");
task.TASK_DUR = nDurValue;
prjDs.Task.AddTaskRow(task);

Guid sessionGuid = Guid.NewGuid();
CheckOutProject(prjGuid, sessionGuid, "Checked out for update.");
Guid jobGuid = Guid.NewGuid();
QueueUpdateProject(jobGuid, sessionGuid, prjDs);

This results in a LastError=GeneralOnlyUpdatesAllowed response from the
project server. Any help I could get interpretting what this means would be
greatly appreciated.

Thanks in advance.

Mike Glen

unread,
Feb 1, 2008, 5:36:32 AM2/1/08
to
Hi albupp ,

Thanks for posting your solution. :) Perhaps next time, try posting on the
developer newsgroup. Please see FAQ Item: 24. Project Newsgroups. FAQs,
companion products and other useful Project information can be seen at this
web address: http://project.mvps.org/faqs.htm

Mike Glen
Project MVP


albupp wrote:
> I was able to resolve this error by following the C# code example in
> the MS Office Project SDK help, under QueueUpdateProject method.


shahajigole

unread,
Dec 28, 2009, 4:58:59 PM12/28/09
to
I had the same issue. I wanted to add new task in existing project. Initially I was trying with "QueueUpdateProject" method. Later on I understood that this method is just to update or modify the existing entities and NOT to add new entities.

I refered MS office project SDK and I found "QueueAddToProject" method, which allows to add new entities. But this alone didn't solve the problem. I had call "QueuePublish" method appear the newly added task on the list.

I hope this helps you.

Thanks,
Shahaji.

Mike Glen wrote:

Hi albupp ,Thanks for posting your solution.
01-Feb-08

Hi albupp ,

Thanks for posting your solution. :) Perhaps next time, try posting on the
developer newsgroup. Please see FAQ Item: 24. Project Newsgroups. FAQs,
companion products and other useful Project information can be seen at this
web address: http://project.mvps.org/faqs.htm

Mike Glen
Project MVP


albupp wrote:

Previous Posts In This Thread:

On Wednesday, January 30, 2008 4:59 PM
albup wrote:

Error updating a project via PSI
Greetings Everyone,

Thanks in advance.

On Thursday, January 31, 2008 4:54 PM
albup wrote:

I was able to resolve this error by following the C# code example in the MS
I was able to resolve this error by following the C# code example in the MS
Office Project SDK help, under QueueUpdateProject method.

On Friday, February 01, 2008 5:36 AM
Mike Glen wrote:

Hi albupp ,Thanks for posting your solution.
Hi albupp ,

Thanks for posting your solution. :) Perhaps next time, try posting on the
developer newsgroup. Please see FAQ Item: 24. Project Newsgroups. FAQs,
companion products and other useful Project information can be seen at this
web address: http://project.mvps.org/faqs.htm

Mike Glen
Project MVP


albupp wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
FREEWARE: ClearCache IE Cache Control Utility
http://www.eggheadcafe.com/tutorials/aspnet/acf0f4e8-0dad-4fed-8ee3-133591db718a/freeware-clearcache-ie-c.aspx

P P

unread,
Sep 14, 2011, 1:00:28 PM9/14/11
to
Hi shahaji,

I note has helped me to relove "LastError=GeneralOnlyUpdatesAllowed" error.

Thanks lot!!!!!

working code:
private void addTask(Guid existingProjectGUID)
{
//Read given work plan
ProjectWebService.ProjectDataSet projectDataSet = new ProjectWebService.ProjectDataSet();
projectDataSet = _projectWS.ReadProject(existingProjectGUID, ProjectWebService.DataStoreEnum.WorkingStore);

//add Task1 to project
ProjectWebService.ProjectDataSet.TaskRow taskOne = projectDataSet.Task.NewTaskRow();
taskOne.PROJ_UID = existingProjectGUID;
taskOne.TASK_UID = Guid.NewGuid();
taskOne.TASK_NAME = "Task 5";
taskOne.TASK_DUR_FMT = (int)PSLibrary.Task.DurationFormat.Day;
taskOne.TASK_DUR = 4800; // 8 hours in duration units (minute/10)[ 4800/10 = 480/8]
string startDate = "9/12/2011";
taskOne.TASK_START_DATE = DateTime.Parse(startDate);
//taskOne.TASK_IS_SUMMARY=true;
projectDataSet.Task.AddTaskRow(taskOne);


//add Task2.2 to project
ProjectWebService.ProjectDataSet.TaskRow taskTwo = projectDataSet.Task.NewTaskRow();
taskTwo.PROJ_UID = existingProjectGUID;
taskTwo.TASK_UID = Guid.NewGuid();
taskTwo.TASK_NAME = "Task 5.1";
taskTwo.TASK_OUTLINE_LEVEL = 2;
// The Task Duration format must be specified.
taskTwo.TASK_DUR_FMT = (int)PSLibrary.Task.DurationFormat.Day;
taskTwo.TASK_DUR = 4800; // 8 hours in duration units (minute/10)
startDate = "9/13/2011";
taskTwo.TASK_START_DATE = DateTime.Parse(startDate);
//taskTwo.StatusManager = "WILL SET GUID HERE"

projectDataSet.Task.AddTaskRow(taskTwo);


Guid sessionGuid = Guid.NewGuid();

//Check-out the work plan
_projectWS.CheckOutProject(existingProjectGUID, sessionGuid, "Checkout");

// Save the project to the database.
bool validateOnly = false;

_projectWS.QueueAddToProject(Guid.NewGuid(), sessionGuid, (ProjectWebService.ProjectDataSet)projectDataSet.GetChanges(), validateOnly);

//_projectWS.QueueUpdateProject(Guid.NewGuid(), sessionGuid, (ProjectWebService.ProjectDataSet)projectDataSet.GetChanges(), validateOnly);

//Check-in the work plan
_projectWS.QueueCheckInProject(Guid.NewGuid(), existingProjectGUID, true, sessionGuid, string.Empty);

//publis the project
_projectWS.QueuePublish(Guid.NewGuid(), existingProjectGUID, true, string.Empty);
>> Office Project SDK help, under QueueUpdateProject method.


>>> On Friday, February 01, 2008 5:36 AM Mike Glen wrote:

>>> Hi albupp ,
>>>
>>> Thanks for posting your solution. :) Perhaps next time, try posting on the
>>> developer newsgroup. Please see FAQ Item: 24. Project Newsgroups. FAQs,
>>> companion products and other useful Project information can be seen at this
>>> web address: http://project.mvps.org/faqs.htm
>>>
>>> Mike Glen
>>> Project MVP
>>>
>>>
>>> albupp wrote:


0 new messages