none
How do i add a project custom field to a project using psi? RRS feed

  • Question

  • I've created a project with tasks, dependencies, enterprise resources, assignments, and now i need to add existing custom fields using the PSI. Below is a portion of the code I'm trying to use to create the ProjectCustomField. I didn't recieve any errors but when i ran Projtool the ProjectCustomField tab was empty.

    projectDs =

    new ProjectWebSvc.ProjectDataSet();

    ProjectWebSvc.

    ProjectDataSet.ProjectCustomFieldsRow cfRow = projectDs.ProjectCustomFields.NewProjectCustomFieldsRow();

     

    cfRow.MD_PROP_UID = (

    Guid)reader[index];

    cfRow.TEXT_VALUE = (

    string)reader[index];

    cfRow.CUSTOM_FIELD_UID =

    Guid.NewGuid();

    cfRow.PROJ_UID = projectRow.PROJ_UID;

    projectDs.ProjectCustomFields.AddProjectCustomFieldsRow(cfRow);

    jobId =

    Guid.NewGuid();

    projectSvc.QueueAddToProject(jobId, sessionUid, projectDs,

    false);

    WaitForQueue(q, jobId);

     

    I would greatly appreciate any advice or help on adding custom fields to my project. Thanks.

    -Joe
    Tuesday, July 27, 2010 6:55 PM

Answers

  • Hey Brian,

    It turns out my program was running an old classlibrary dll that hadnt been updated with my added custom field method. Anyways I have it working now, but I greatly appreciate your help, thank you very much.

    -Joe

    Wednesday, July 28, 2010 5:37 PM

All replies