none
MS Project 2007: How to set up Project and Task level Properties using PSI method

    Question

  • Hi,

    I am creating the Project of type Template using QueueCreateProject() method of Project PSI. The Template is being created successfully using Project PSI but I am getting trouble while setting up the properties like...

    1. Set the Standard Calendar

    2. Set to display the Project Summary task

    3. Set the Task Usage view as a default view of Template

    4. Add the extra field to Task Usage view and display it

    5. Set up the Predecessor and Successor for Tasks

    The Project PSI Dataset does not show the above properties to set.

    Please let me know if anyone has answer for this.

    Thanks in Advance!!!

    ...Ajju

    Tuesday, November 02, 2010 4:32 AM

Answers

All replies

  • Hi Ajjudesh,

    I'm not aware of any way to set the first 4 items in your list via the PSI.  For the 5th item take a look at the ProjectDataSet.DependencyDataTable class.  This allows you to set dependency relationships between one task and another.

    Best regards,

    Brian.


    Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page
    Tuesday, November 02, 2010 9:23 PM
    Owner
  • Hi Brian,

    Thanks a lot for your reply.

    Can you please send me some links containing sample code for implementing Predecessor and Successor for Task. I have seen lot of sample code for doing this but I want to set Pred and Succ while creating tasks for Template.

    Basically I need a sample code to implement LinkPredecessors() method of Task Class. Brian, can you please help me for that?

    Thanks in Advance!!!

    ...Ajju

     

       

    Tuesday, November 09, 2010 11:57 AM
  • Hi Ajju,

    What LinkPredecessors method or Task class are you referring to? They don't exist in the PSI (except Task is in Microsoft.Office.Project.Server.Library for field definitions).

    The PSI has the QueueUpdateProject method, which can update task predecessors and successors by using data in ProjectDataSet.DependencyDataTable, as Brian noted. For an example of what goes in the DependencyDataTable, you can use ProjTool to view task dependencies, and then change the dependencies and see what happens when ProjTool calls QueueUpdateProject. See ProjTool for Project Server 2010 in the project_programmability blog.

    --Jim


    Jim Corbin [MSFT]
    Tuesday, November 09, 2010 3:50 PM
    Moderator
  • Hi Ajju,

    You should be able to set the Project Calendar on project creating using PSI by specifying the CAL_UID (http://msdn.microsoft.com/en-us/library/websvcproject.projectdataset.projectrow.cal_uid.aspx)

    As far as I know, item 2 to 4 can only be set using the client Object Model, not by the PSI.

    Predeccesors can be set as explained by Brian and Jim.

    I hope this helps,
    Hans


    My EPM blog: Projectopolis
    Tuesday, November 09, 2010 3:58 PM
    Moderator
  • Hi Jim,

    Thanks for your reply.

    Actually I wanted to set the predecessor and sucessor in project dataset before saving the project. Your solution help me and I am able to add the predecessor and sucessor using DepencyDataTable.

    But Pred and Succ could not set correctly so I have one followed question to you.

    When I add Dependency Row in DependecyDatatable, it requires both Link_Prec_UID and Link_Succ_UID but when I loop through "Task in Project.Tasks" there I could not get both Link_Prec_UID and Link_Succ_UID for some tasks. I get only Link_Succ_UID. So how can I set the Pred for that task?

    Thanks in Advance!!!

    ...Ajju 

    Wednesday, November 10, 2010 11:00 AM
  • When you are adding a row in the DependencyDataTable, the dependency does not exist yet, until you call QueueAddToProject.

    1. Suppose a project has tasks T1, T2, and T3, then you add a Tnew task (all automatically scheduled; TASK_IS_MANUAL = false) by calling QueueAddToProject.
    2. Then add a dependency row, where the LINK_PRED_UID is for T3, and the LINK_SUCC_UID is for Tnew, and call QueueAddToProject again. You might be able to combine both changes in one call -- I haven't tried that.

    You can manually do that in ProjTool, in the Project Details page, to see the results, save the ProjectDataSet to examine, and then check in the project and open it in WinProj. Btw, I gave you the ProjTool link for Project Server 2010 above. ProjTool for Project Server 2007 is in the Project 2007 SDK download.

    Here are the Dependency rows in that example, aftger calling QueueAddToProject:

     <Dependency>
     <LINK_UID>abf949b5-9629-47ac-9027-151581a087c8</LINK_UID>
     <PROJ_UID>f195097b-e885-4d71-9ca1-5e84c0dec851</PROJ_UID>
     <LINK_PRED_UID>9dc7e457-297b-44df-a0a5-d2213d979443</LINK_PRED_UID> <-- T2
     <LINK_SUCC_UID>ec253887-70a6-4aa9-bcb0-587441930341</LINK_SUCC_UID> <-- T3
     <LINK_TYPE>1</LINK_TYPE>
     <LINK_LAG>0</LINK_LAG>
     <LINK_LAG_FMT>7</LINK_LAG_FMT>
     </Dependency>
     <Dependency>
     <LINK_UID>a1b4e190-5d5d-4f6b-a4b8-384db974a677</LINK_UID>
     <PROJ_UID>f195097b-e885-4d71-9ca1-5e84c0dec851</PROJ_UID>
     <LINK_PRED_UID>43229fcf-0927-44df-8aae-be770316e0da</LINK_PRED_UID> <-- T1
     <LINK_SUCC_UID>9dc7e457-297b-44df-a0a5-d2213d979443</LINK_SUCC_UID> <-- T2
     <LINK_TYPE>1</LINK_TYPE>
     <LINK_LAG>0</LINK_LAG>
     <LINK_LAG_FMT>7</LINK_LAG_FMT>
     </Dependency>
     <Dependency>
     <LINK_UID>ab067914-5cdc-4730-9e70-cea8702b885f</LINK_UID>
     <PROJ_UID>f195097b-e885-4d71-9ca1-5e84c0dec851</PROJ_UID>
     <LINK_PRED_UID>ec253887-70a6-4aa9-bcb0-587441930341</LINK_PRED_UID> <-- T3
     <LINK_SUCC_UID>2d3d97e3-d765-487f-a612-27bc829432cd</LINK_SUCC_UID> <-- Tnew
     <LINK_TYPE>1</LINK_TYPE>
     <LINK_LAG>0</LINK_LAG>
     <LINK_LAG_FMT>7</LINK_LAG_FMT>
     </Dependency>
    
    --Jim
    Jim Corbin [MSFT]
    Wednesday, November 10, 2010 4:18 PM
    Moderator