Project Server 2003 does not actually provide much capabilities around master and sub projects, but we can still leverage the available capabilities.
To create Master and Sub Projects in Project Server 2003 programmatically, Project Data Services (PDS) cannot be used and hence we have to write PDS Extenders for that. With PDS Extenders you need to know the tables that has to be updated, as Extenders are nothing but a set of stored procedures which will be called in a set of methods and the methods in turn will be executed by the PDS Web Service itself. Well, I'm not going into the details of how to write a PDS Extender or how to register it so that the PDS Web Service can find the methods and execute them.
There are three tables that need to be edited/updated while creating Master & Sub Projects:
MSP_TASKS, MSP_TEXT_FIELDS, MSP_PROJECTS.
Here's the steps that needs to be followed:
1. Create a task in the MSP_TASKS table. The columns that need to be set are:
PROJ_ID -> Valid PROJ_ID in the MSP_PROJECTS table. This will be PROJ_ID of the master project.
TASK_UID -> Unique Identifier for the task. This will be created automatically if not provided.
TASK_ID -> The position identifier of the task within the list of tasks for that project.
TASK_NAME -> Name of the task. In this case, name of the project that needs to be inserted.
EXT_EDIT_REF_DATA -> Must be set to 1 to indicate this task is a new task.
2. Create an entry for that task in the MSP_TEXT_FIELDS table. The columns that need to be set are:
PROJ_ID -> Refers to a valid PROJ_ID in the MSP_PROJECTS table. This will be the PROJ_ID of the master project.
TEXT_CATEGORY -> Set this to 0 to indicate a task.
TEXT_REF_UID -> Refers to a valid UID in the MSP_TASKS table. Give the UID of the task created in Step 1.
TEXT_FIELD_ID -> For inserted projects, this ID will be set as 188743706.
TEXT_VALUE -> The name of the project to be inserted or the name of the task created in Step1.
3. Update the MSP_PROJECTS table for Project to know that data has been edited externally
PROJ_EXT_EDITED -> Must be set to 1 for Project to process.
PROJ_EXT_EDITED_TEXT -> Must be set to 1 for Project to process.
After preforming these editions, when you open the project using Microsoft Project Professional you can see that the project contains inserted project (along with the inserted project's tasks) listed. Also, when you make changes to the inserted project, the changes will be applied to the actual project and vice versa.
Enjoy creating inserted projects!
Ciao, Akila.