none
Project Server 2010 Event Handler RRS feed

  • Question

  • I am working on OnPublished event handler that will update one custom field of a project based on change in another field.

    I am getting an error

    Event Handler for event \ProjectPublished\ of type \PS.UpdateProjectStatusChangeDate.EventHandlerUpdateField\ threw an exception: ProjectServerError(s) LastError=CICOCheckedOutToOtherUser Instructions: Pass this into PSClientError constructor to access all error information

    This is the code

                //loading project data from server
                //Every change on this dataset will be updated on the server!
                ProjectDataSet projectDs = projectClient.ReadProject(projectId, projectSvc.DataStoreEnum.WorkingStore);

                foreach (projectSvc.ProjectDataSet.ProjectRow row in projectDs.Project)
                {
                    if (row.PROJ_SESSION_UID != null)
                    {
                        sessionId = row.PROJ_SESSION_UID;
                        break;
                    }
                }
               //send the dataset to the server to update the database
               bool validateOnly = false;
               Guid jobId = Guid.NewGuid();
               projectClient.QueueUpdateProject(jobId, sessionId, projectDs, validateOnly);

    Unlike other answers where we are running the code when the project is in checked-in state, we are checking-out and assigning new SessionID.
    But when the event handler fires, the project is already is checked-out. So how do I get the SessionID?

    I think that is where the code is breaking.

    Any help will be appreciated.

    Tuesday, March 5, 2013 1:17 PM

Answers

All replies

  • Hi To all,

    I am also facing the same issue

    i am getting sessionid

    but when updating project while onsaved event getting same problem my code is similar to above code

    error:ProjectServerError(s) LastError=CICOCheckedOutToOtherUser

    any help will useful to me

    thanks in advance


    SENA

    Friday, August 1, 2014 11:04 AM
  • Hi

    Either you need to perform the operation on the same session with impersonation or you need to do a force checkin and checkout for your session for an update.

    --Hope this helps


    Thanks --Ajith

    Thursday, August 7, 2014 3:31 PM
    Moderator