Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7596759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:59:47+00:00 2026-05-30T21:59:47+00:00

I’m new to Project Server development and was wondering if you can use the

  • 0

I’m new to Project Server development and was wondering if you can use the PSI to set resource custom field values.

I can’t seem to find any information for a beginner at this.

I currently have web references set up for the CustomFields and the Resource web service, but am unsure how to set a custom field for a particular resource.

Any help would be really appreciated!

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:59:48+00:00Added an answer on May 30, 2026 at 9:59 pm

    I know your problem. Microsoft has really bad examples on MSDN. Lot of stuff doesn’t work or has just been copied from the 2007 manual. I’ve started yesterday to develop with the Webservice for Project Server 2010.

    Here is a simple (maybe not the best) solution for setting custom fields:

    Complete source code: http://pastebin.com/tr7CGJsW

    Prepare your solution

    First I’ve added a Service Reference to:

    http: //servername/instance/_vti_bin/PSI/Project.asmx?wsdl

    Service Reference

    After that, I’ve edited the app.config because I had to use special credentials to login into the project server (maybe this is not necessarily for you):

    ...
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
        <!--<security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
        </security>-->
    </binding>
    

    The commented code has been created by Visual Studio

    Connect and Update

    Now we can create a new SoapClient which communicates with the Project Server:

    //Creating a new service client object
    ProjectSoapClient projectSvc = new ProjectSoapClient();
    
    //Just if you need to authenticate with another account!
    projectSvc.ClientCredentials.Windows.ClientCredential = new NetworkCredential("test", "test", "demo");
    projectSvc.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
    

    Now I have declared two Guids, that we know, what we want to update. The other variables are used later and are comment in the code:

    //Guid of my project
    Guid myProjectId = new Guid("{610c820f-dc74-476c-b797-1e61a77ed6c6}");
    
    //Guid of the custom field
    Guid myCustomFieldId = new Guid("{cd879634-b3ee-44eb-87f7-3063a3523f45}");
    
    //creating a new sessionId and a new jobId
    Guid sessionId = Guid.NewGuid(); //the sessionId stays for the whole updating process
    Guid jobId = Guid.NewGuid(); //for each job, you give to the server, you need a new one
    
    //indicator if you have to update the project
    Boolean updatedata = false;
    

    Then we are ready to load the ProjectDataSet from the server, find the CustomField and updating the data. It’s really simple:

    1. loading the ProjectDataSet
    2. iterate trough the CustomFieldsRow
    3. checking if the CustomField matches with our Guid
    4. updating the value
    5. setting the indicator to update
    //loading project data from server
    //Every change on this dataset will be updated on the server!
    ProjectDataSet project = projectSvc.ReadProject(myProjectId, DataStoreEnum.WorkingStore);
    
    //To find your custom field, you have to search for it in the CustomFieldsRow
    foreach (ProjectServerCSVImport.PSS.Project.ProjectDataSet.ProjectCustomFieldsRow row in project.ProjectCustomFields)
    {
        //check if the GUID is the same
        if (row.MD_PROP_UID == myCustomFieldId)
        {
            //if yes, write it into the container
            row.NUM_VALUE = 12345;
    
            //and set the indicater
            updatedata = true;
        }
    }
    

    If we changed a value, we have to send the ProjectDataSet to the ProjectServer now. It will update the changed values in the ProjectDataSet. For this, we have to check out our project, update it and check in again:

    //update if you have changed anything
    if (updatedata)
    {
        //check out the project first
        projectSvc.CheckOutProject(myProjectId, sessionId, "custom field update checkout");
    
        //send the dataset to the server to update the database
        bool validateOnly = false;
        projectSvc.QueueUpdateProject(jobId, sessionId, project, validateOnly);
    
        //wait 4 seconds just to be sure the job has been done
        System.Threading.Thread.Sleep(4000);
    
        //create a new jobId to check in the project
        jobId = Guid.NewGuid();
    
        //CheckIn
        bool force = false;
        string sessionDescription = "updated custom fields";
        projectSvc.QueueCheckInProject(jobId, myProjectId, force, sessionId, sessionDescription);
    
        //wait again 4 seconds
        System.Threading.Thread.Sleep(4000);
    

    But now we just have updated the database. The server will still show us the “old” value and not the new one. This is because we didn’t have published our project yet:

    //again a new jobId to publish the project
    jobId = Guid.NewGuid();
    bool fullPublish = true;
    projectSvc.QueuePublish(jobId, myProjectId, fullPublish, null);
    
    //maybe we should wait again ;)
    System.Threading.Thread.Sleep(4000);
    

    Finally we’re done and our project is updated!

    Enhancements

    I’m very new to this platform (Project Server 2010), so this code maybe is not the best example. So there are some enhancements, which would made the solution better:

    • The Sleep function is a very bad workaround, but I couldn’t find an example which handles the same thing (like here) with a QueueSystem for 2010?!
    • If you don’t know the Guid of your project, but the name, you can resolve it by following function:
    /// <summary>
    /// Returns the GUID for a specified project
    /// and sets the guid for this class
    /// </summary>
    /// <param name="client">soap service client</param>
    /// <param name="projectname">name of the project</param>
    /// <returns>Project GUID</returns>
    public Guid GetGuidByProjectName(ProjectSoapClient client, string projectname)
    {
        Guid pguid = new Guid();
        ProjectDataSet data = client.ReadProjectList();
    
        foreach (DataRow row in data.Tables[0].Rows)
        {
            if (row[1].ToString() == projectname) //compare - case sensitive!
            {
                pguid = new Guid(row[0].ToString());
            }
        }
    
        return pguid;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I want use html5's new tag to play a wav file (currently only supported
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.