none
RemoveDependencyRow method is not working properly RRS feed

  • Question

  • We are trying to use

    RemoveDependencyRow method to remove the interproject dependencies.

    The

    QueueUpdateProject is throwing error saying OnlyAddition allowed.

    Have you tried using the RemoveDependencyRow method successfully anytime?

    Here is the CODE.

                        const int PROJECT_ENTITY_TYPE_DEPENDENCY = 16;

                               SvcProject.ProjectDataSet projD = new SvcProject.ProjectDataSet();                   

                            projD = projectClient.ReadProjectEntities(projUid, PROJECT_ENTITY_TYPE_DEPENDENCY, SvcProject.DataStoreEnum.WorkingStore);

                        foreach (DataRow dataRow in dependencyDataSet.Tables[0].Rows)
                        {
                            SvcProject.ProjectDataSet.DependencyRow dependencyRow
                                = projD.Dependency.FindByLINK_UIDPROJ_UID(((Guid)linkGuid,
                                , (Guid)projGuid);
                                projD.Dependency.RemoveDependencyRow(dependencyRow);
                                projD.Dependency.AcceptChanges();
                        }
                        projD.AcceptChanges();

                        jobId = new Guid();
                        startTime = DateTime.Now;
                        projectClient.QueueUpdateProject(jobId, sessionId, projD, false);

                        Helpers.WaitForQueue(backendQueueSystem.QueueMsgType.ProjectUpdate,
                                             1, queueSystemClient, startTime);

                        string SESSION_DESCRIPTION = "PSI CheckIn utility";
                        // CheckIn the Project
                        jobId = Guid.NewGuid();
                        projectClient.QueueCheckInProject(jobId, projUid, true, sessionId, SESSION_DESCRIPTION);

                        // Publish the Project
                        startTime = DateTime.Now;
                        jobId = Guid.NewGuid();
                        projectClient.QueuePublish(jobId, projUid, true, String.Empty);
                        Helpers.WaitForQueue(backendQueueSystem.QueueMsgType.PublishNotifications,
                                             1, queueSystemClient, startTime);


    • Edited by bhardia Thursday, May 16, 2013 3:43 PM
    Thursday, May 16, 2013 5:37 AM

All replies

  • Is this wrong thread or no one has tried removing external dependencies using the code?

    The code may be a wrong approach. Not looking to get the code however to get the direction to resolve "How to remove external dependencies using PSI" for Project Server 2010 projects. 

    Friday, May 17, 2013 6:16 PM
  • Could it be that you're looping through several dependencies:

    (foreach (DataRow dataRow in dependencyDataSet.Tables[0].Rows))

    and then the code tries to remove the exact same dependency several times in that loop:

    SvcProject.ProjectDataSet.DependencyRow dependencyRow
                                = projD.Dependency.FindByLINK_UIDPROJ_UID(((Guid)linkGuid,
                                , (Guid)projGuid);

    /Lars Hammarberg

    www.connecta.se


    //Lars Hammarberg www.dovregroup.com Gold Certified Partner

    Sunday, May 19, 2013 12:08 PM
  • Lars,

    Thanks for the reply. 

    During the debug I checked and the dependencies did not remove the same one multiple times. So that is not the case.

    Just spoke to Microsoft support and I was told that addition/deletion of "External Dependencies" are NOT supported through PSI.

    Has anyone done it before by some other means?

    Monday, May 20, 2013 8:10 PM