Custom fields update for assignments using PSI (project server 200

R

Rayees Wani

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.
 
B

Bryan Phelps

Hi Rayees!

This is actually a bug / known issue with the Update PSI when dealing with
assignments. This only happens when you have a RowState of Modified with an
assignment custom field row. The workaround is, instead of modifying the row,
delete that row, and add a new custom fields row.

When you create the new row, be sure to set CUSTOM_FIELD_UID to
Guid.NewGuid(), set PROJ_UID, ASSN_UID, MD_PROP_UID, and CODE_VALUE
appropriately.

Hope that helps! Let me know how it goes :)

Thanks,
Bryan
 
Joined
Aug 31, 2014
Messages
1
Reaction score
0
Hi Bryan,

I tried above solution but it throws below error.

ProjectServerError(s) LastError=TaskCannotModifyProjectSummary Instructions: Pass this into PSClientError constructor to access all error information

Here is the code;

EPMProjectService.ProjectDataSet.AssignmentCustomFieldsRow newAssnRow;
newAssnRow = projectDs.AssignmentCustomFields.NewAssignmentCustomFieldsRow();

newAssnRow.CUSTOM_FIELD_UID = CUSTOM_FIELD_UID;
newAssnRow.PROJ_UID = PROJ_UID;
newAssnRow.ASSN_UID = ASSN_UID;
newAssnRow.MD_PROP_UID = MD_PROP_UID;
newAssnRow.MD_PROP_ID= MD_PROP_ID;
// newAssnRow.DUR_FMT = (int)PSLibrary.CustomField.Type.
newAssnRow.FIELD_TYPE_ENUM = (int)PSLibrary.CustomField.Type.DURATION;
newAssnRow.DUR_VALUE = Dur_Value;

projectDs.AssignmentCustomFields.AddAssignmentCustomFieldsRow(newAssnRow);


Thanks,
Bapusaheb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top