none
How can I change the EPT for a project using PSI? RRS feed

  • General discussion

  • Hi:

    Actually I have 3 questions related to PSI (I'm new to .Net programming):

    1. How can I change the Enterprise Project Type of a project (from 'Sample Proposal' to 'Basic Project Plan' for example) using PSI?

    2. How can I change a Custom Enterprise Field value for a project (that point to a Lookup Table)?

    3. Can I use Visual Studio 2010 Express to do this?

    On the other hand, is there any tool available to modify the value of a field for a list of projects in PWA?.

    Thank you very much

    Regards

    Carlos Negroni

    Friday, November 9, 2012 10:42 PM

All replies

  • Hi Carlos,

    Have you download SDK for Project Server?Go through the following, you'll find good resource there.

    PS SDK

    PS SDK

    In the SDK there's a tool called ProjTool, you can do many of the things you're looking for. You have to configure few things before using it.

    Project Tools

    Hope this helps you.

    Thanks


    Thanks, Kashif

    Tuesday, November 13, 2012 11:03 AM
  • Hi there--

    1. How can I change the Enterprise Project Type of a project (from 'Sample Proposal' to 'Basic Project Plan' for example) using PSI?
    http://msdn.microsoft.com/en-us/library/gg229260(v=office.14).aspx

    2
    How can I change a Custom Enterprise Field value for a project (that point to a Lookup Table)?
    - Renke has already shared a link from Brian's article

    3.
    Can I use Visual Studio 2010 Express to do this?
    No, You will need VS 2010 Professional/ Premium or ultimate versions.

    HTH.


    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”. Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82

    Wednesday, November 14, 2012 9:47 AM
  • Hello,

    I want to change the Custom field value of Project Server 2010. I am following the brain article. My problem is the code run successfully but the changes did not reflect to the Project server. Following is my code, Any Help??

    private void UpdateRecordInProjectServer(string newValue, string projGuid, string propertyToEdit)
            {
                ProjectSoapClient projectSvc = new ProjectSoapClient();
                CustomFieldsSoapClient customfieldSvc = new CustomFieldsSoapClient();
                CustomFieldDataSet fieldDefs = customfieldSvc.ReadCustomFields(string.Empty, false);
                LookupTableSoapClient loockuptableSvc = new LookupTableSoapClient();

                Guid projectId = new Guid(projGuid);
                ProjectDataSet projectDs = projectSvc.ReadProject(projectId, ListProjects.Project.DataStoreEnum.WorkingStore);

                foreach (ProjectDataSet.ProjectCustomFieldsRow cfRow in projectDs.ProjectCustomFields.Rows)
                {
                   // projectDs.ProjectCustomFields.RemoveProjectCustomFieldsRow(cfRow);
                    CustomFieldDataSet.CustomFieldsRow fieldDefinition = fieldDefs.CustomFields.Single(
                            cfd => cfd.MD_PROP_UID == cfRow.MD_PROP_UID);
                    if (fieldDefinition.MD_PROP_NAME == propertyToEdit)
                    {
                        cfRow.TEXT_VALUE = newValue;
                    }
                    //projectDs.ProjectCustomFields.AddProjectCustomFieldsRow(cfRow);
                    projectDs.ProjectCustomFields.AcceptChanges();
                }
                
                Guid sessionUid = Guid.NewGuid();
                Guid jobUid = Guid.NewGuid();
                if (!IsProjectCheckedOut(projectId))
                {
                    projectSvc.CheckOutProject(projectId, sessionUid, "Updating CF");
                    jobUid = Guid.NewGuid();
                    projectSvc.QueueUpdateProject(jobUid, sessionUid, projectDs, false);
                    System.Threading.Thread.Sleep(4000);
                }
                jobUid = Guid.NewGuid();
                projectSvc.QueueCheckInProject(jobUid, projectId, false, sessionUid, "Updating CF");
                System.Threading.Thread.Sleep(4000);
                jobUid = Guid.NewGuid();
                projectSvc.QueuePublish(jobUid, projectId, true, SPContext.Current.Site.Url);
                System.Threading.Thread.Sleep(4000);
            }


    Muhammad Ali

    Thursday, April 11, 2013 8:52 AM