Cascade Skyline - with Microsoft Logo and Project Support header - author Brian Smith

To Add or Update - That is the Question. The PSI and custom fields - Updated

To Add or Update - That is the Question. The PSI and custom fields - Updated

Rate This
  • Comments 46

This posting was inspired by a support call concerning custom fields - but does apply to other entities in the Project dataset and others.  The question was around the QueueUpdateProject and QueueAddToProject web services calls that are part of the Project web service in the PSI.  If you use the wrong call then the error message is usually helpful telling you you can't add with the update call and vice versa.  But the thing that does catch people out are the custom fields... 

By default a project dataset will not contain any rows in the ProjectCustomFields data table unless they have either been set (through PWA, Project Professional or the PSI) or they contain formulae, or are based on a lookup table with a default value defined.  So for a freshly created project (from Project Professional) when looking at Project Information it appears that all custom fields are there - and some may even look to have values (number fields will show 0) whereas in fact once saved there are no rows in the dataset for project custom fields (except as mentioned above - formulae based, and default lookup tables values).  So if you want to set a custom field via the PSI your code should check if there is a row already present for that custom field (identify by the MD_PROP_UID or MD_PROP_ID) and if it is there then you can change the value and use QueueUpdateProject - and if it doesn't exist then you will need to create a new blank project dataset and add a new project custom field row and set the values (including a new GUID for CUSTOM_FIELD_UID, the projects PROJ_UID and the MD_PROP_UID for the field you want to set) then use the QueueAddToProject.

(Update - Although this logic holds true for adding/updating tasks to a Project dataset you can in fact ADD a new custom field row to an existing project dataset and use the QueueUpdateProject method - and it will work.  You do not need to use the QueueAddToProject method - although this will work too, assuming it only contains the additional custom field row!  Thanks to Martin for pointing this out - through experience.)

Just to confuse the situation we have a bug currently when using the PSI or creating an Activity Plan/Proposal that can duplicate custom field rows.  If you have any project level custom fields that use graphical indicators but do not have formulae then you can get duplicate custom field rows created for each of them.  I'm not sure yet if the bug is they get created at all (as they do not get created in Project Professional projects) or that they appear twice. I will post an update when I have more information.  For now a quick workaround is to not use graphical indicators for this type of field.  Cleaning up existing ones may be a little more challenging and I would suggest a support call.  Although this causes problems for the PSI when updating these duplicated rows (so this affects changes for Activity Plans , Proposals and use of the Edit Project Properties in PWA) you can still make changes in Project Professional through the Project Information dialog.

The errors you might see - (these are generic so you could see these errors for other root causes):-

When updating a custom field for an Activity Plan or Proposal you will get an error dialog box:-

Windows Internet Explorer
An error has occurred when saving your project to the server. Please contact your system administrator for assistance.
[GeneralUnhandledException]

When updating a custom field through Project Center's Edit Project Properties option the error will display at the top of the page in red:-

The project could not be saved due to the following reason(s):

An unknown error has occured (occurred is mis-spelled in the error).

When updating through the PSI this will result in a GeneralUnhandledException.

One final point - setting or updating a project custom field for an existing Project Professional created project through the PSI or Edit Project Properties will also introduce this problem.  The extra duplicates will get added as well as the custom field you are setting.

Leave a Comment
  • Please add 8 and 4 and type the answer here:
  • Post
  • Hello Yuvraj,

           Can u please send me the code of how you managed to update the custom field values of a given project.

    I am all confused looking at various materials on the net.

    Thanks a million.

  • hi guys

    i've been trying to create/update a custom field with no luck, here is the code, would you please point me on the error, regards

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

    row.MD_PROP_UID = CustomField.CustomFieldGUID;

    row.CODE_VALUE = LookupTable.GetLookupId(value);

    row.CUSTOM_FIELD_UID = Guid.NewGuid();

    row.PROJ_UID = ProjectID;

    projectDs.ProjectCustomFields.Rows.Add(row);

    i must add everything has been validated and contains the correct values, but when issuing queueUpdateProject the changes don't show up in the project information dialog (Project Professional 2007)

    thanks in advance

  • Hi Gecheverry and Sarfarz,

    If I can't find a sample I will do a posting shortly on this topic.

    Best regards,

    Brian.

  • Hi Brian,

    I'm having a problem when using QueueAddtoProject to add tasks and assignments to a blank project.

    Here's the text of the Queue Error I get:

    Message:'MSP : Queue request Failed for Job ID 3cbbad1d-263e-4fbc-b74e-bb4f06dff0e6.

    <?xml version="1.0" encoding="utf-16"?>

    <errinfo>

     <general>

       <class name="Project">

         <error id="9133" name="ProjectSchedulingEngineException" uid="50ba33e1-6500-49c1-8aad-ecfd43c5e969" exception="Microsoft.Office.Project.Scheduling.SchedulingException: Cannot extend beyond minimum date&#xD;&#xA;   at Microsoft.Office.Project.Server.BusinessLayer.ProjectSchedule.Schedule()&#xD;&#xA;   at Microsoft.Office.Project.Server.BusinessLayer.ProjectMain.HandleProject(ProjectDataSet dataset, Guid projectUid, Guid userUid, String userName, Boolean isNew, Boolean addColumns, ProjectLocks projectLock, Boolean fCheckReadOnly, Boolean fCheckProtectedActuals, Boolean fAllowAddEntRes, Boolean fOptIndexRecalced)" />

       </class>

       <class name="Queue">

         <error id="26000" name="GeneralQueueJobFailed" uid="0044e41a-9645-4d6f-a80c-5becd2ecded4" JobUID="3cbbad1d-263e-4fbc-b74e-bb4f06dff0e6" ComputerName="AU

    I do NOT set any of the Task Start Dates, and I have no constraints on them to dictate the schedule. I have set the Project Start Date though, so I expect the Task Start Dates to default to this date.

    Everything happens fine for most cases of Projects I create, but the above error occurs when I have some assigments on Labour Resources whose ASSN_WORK is very huge, extending over couple of DECADES of work.

    It is absolutely essential that I fix this soon. Huge assignment work data is very much possible in the business I want to integrate Project with.

    Thanks and Regards,

    Subramanian

  • PS: I have the Service Pack 1, the August CU and the Infrastructure update installed.

  • Please refer to: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.project.developer&tid=72ad810e-3295-4bd7-b15f-707d86204544&cat=en_US_ccc93814-89c8-441c-a48f-6e278361455a&lang=en&cr=US&sloc=en-us&m=1&p=1

    Glad if you point out the problem.

  • Hi Subramanian,

    To help isolate the issue I would suggest seeing which value is causing the problem - or which is the smallest value causing the problem.  Also see the Specification topic in the help for details of limits in Project.  Are any of your assignments going out beyond the latest date allowed for calulation in project - December 31, 2049?  

    Best regards,

    Brian.

  • Hi Brian,

    I have lots of PS2007 projects that have been migrated from PS2003. When I fetch the project dataset so I can update and/or add custom field values, it usually works fine. However, sometimes the PSI call complains about some of the other tables in the project dataset. I get the following types of errors when I do the queuepublish.

    AssignmentCannotEditSummaryTask

    ProjectResourceNotFound

    AssignmentNotFound

    My code has not touched those tables in the dataset.  How do I get around this problem?

    Thanks much!

    Ken Henderson

  • Hi Ken,

    I have seen very similar errors arise when creating projects via the PSI from migrated projects.  I thought we had those issues resolved. What CU do you have loaded?

    Best regards,

    Brian

  • Regarding refreshing Custom Fields using the PSI.

    We have a situation where a Project manager creates a new Calculated Project Custom Field and adds it to a View. All projects that have not been republish via Project pro have empty values in the new custom field. However when you republish with Project Pro the calulation is fired and the custom field contains a value.....Very Simple.

    The problem is when you want to refresh projects is Project center using the PSI. QueuePublish or QueueUpdateProject does not refresh / Recalulate custom fields.

    The reason why it does not refresh against a project is because the assocoation between the Project and the master custom field has not been made. Project Pro automaticaly creates a new association when you publish a project.

    So... You need to check which custom fields have been associated to a project and then Add missing custom fields using QueueAddToProject...

    If anyone knows of another way PLEASE let me know.....Hope this helps...

  • Regarding refreshing Calculated Task Custom Fields using the PSI:

    I have been having trouble with calculated task  custom fields, using the PSI.

    When I republish (full publish) a project through the PSI and then check Project Center(PWA), the calculated fields are not updated.

    I've also tried to force the value into the calculated field but trying to Save the Project gets me a SoapException with the error "CustomFieldCannotSetValueOnFormulaFields".

    Does anyone know how can I mimic the behavior

    of Project Pro?

    Thanks in Advance.

  • hello guys .

    i am able to add, update project, task and assignment custom field rows with or without lookups successfully after having to go through as much documentation as possible.

    But i am badly stuck when i try to update   assignment customfield on which lookup is applied. It allows me to write the code value here

    custRow.CODE_VALUE = codevalue;

    but at Queueupdate()

    it throws the unhandled exception.

    System.Web.Services.Protocols.SoapException: ProjectServerError(s) LastError=GeneralUnhandledException Instructions: Pass this into PSClientError constructor to access all error information

      at Microsoft.Office.Project.Server.WebService.Project.QueueUpdateProject(Guid jobUid, Guid sessionUid, ProjectDataSet dataset, Boolean validateOnly)

    Please help .

    thanks in advance

    Rayees.

  • Hi Rayees,

    I posted back on the 2010 forum and gave a couple of suggestions.  I don't have an answer for you, but see how those tips work (adding new CF that doesn't exist, and trying the statusing web part.)

    Best regards,

    Brian.

  • Hi Brian,

    We migrated projects from 2003 to 2007 and are using PSI calls for updating projects, publishing, etc.  Numerous projects are causing PSI errors to be thrown, one such error is AssignmentCannotEditSummaryTask, although we are just updating custom field values.  There are 4 assignments in a summary task for this project, we can modify the project in ProjectPro, publish, etc, but not through PSI.  One other error we are receiving is a "CustomFieldInvalidTypeColumnFilledIn" error (different project), but cannot replicate it on our development or training environment.  Any suggestions?  Any help would be greatly appreciated.

  • Hi Brian

    I have a new way to generate this error !!!!

    If you move a project into a catagory with "Manage security" rights but not "Manage Check-Ins"... You to can be blessed with a typo error from above... <Project Server 2007+SP2+FebCU10>

Page 3 of 4 (46 items) 1234