Updating actual work with PSI

%3CLINGO-SUB%20id%3D%22lingo-sub-1069776%22%20slang%3D%22en-US%22%3EUpdating%20actual%20work%20with%20PSI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1069776%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20doing%20integration%20with%20Sharepoint%20and%20use%20PSI.%20I%20have%20some%20troubles%20with%20writing%20actual%20work%2C%20I%20use%20WebSvcStatusing.Statusing.UpdateStatus%20method%20and%20PeriodChange%20element%20for%20xml%2C%20but%20after%20running%20the%20code%20i%20can't%20see%20anything%20in%20Approval%20Center.%20If%20i%20call%20the%20QueueApplyStatusApprovals%20method%20it%20fails%20with%20JobState.Unknown.%20I%20tried%20to%20change%20the%20project%20calendar%20to%20standard%20calendar%20and%20everything%20worked%20out%20but%20with%20custom%20calendar%20it%20doesn't%20work.%20I%20use%20material%20resources%20and%20own%20the%20assignment.%20When%20i%20searched%20the%20error%20message%20in%20uls%20logs%20there%20was%20an%20SQL%20error%20with%20the%20code%20535%20that%20says%20%22%3CSPAN%3EThe%20datediff%20function%20resulted%20in%20an%20overflow.%20The%20number%20of%20dateparts%20separating%20two%20date%2Ftime%20instances%20is%20too%20large.%20Try%20to%20use%20datediff%20with%20a%20less%20precise%20datepart.%3C%2FSPAN%3E%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3Estring%20changeXml%20%3D%20CreateChangeXml(projUid%2C%20assnUid%2C%20resUid%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20hoursWorked%2C%20regularWork%2C%20true)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0AstatusingClient.UpdateStatus(changeXml)%3B%0AstatusingClient.SubmitStatus(new%20Guid%5B%5D%20%7B%20assnUid%20%7D%2C%20%22Updated%20actual%20work%22)%3B%0A%0ASvcStatusing.StatusApprovalDataSet%20statusApprovalDs%20%3D%20statusingClient.ReadStatusApprovalsSubmitted(false)%3B%0Afor%20(int%20i%20%3D%200%3B%20i%20%26lt%3B%20statusApprovalDs.StatusApprovals.Count%3B%20i%2B%2B)%0A%7B%0A%20Console.WriteLine(%22Approving%20assignment%20update%20for%20%7B2%7D%20to%20%7B0%7D%20in%20%7B1%7D.%22%2C%20statusApprovalDs.StatusApprovals%5Bi%5D.TASK_NAME%2C%20statusApprovalDs.StatusApprovals%5Bi%5D.PROJ_NAME%2C%20statusApprovalDs.StatusApprovals%5Bi%5D.RES_NAME)%3B%0A%20statusApprovalDs.StatusApprovals%5Bi%5D.ASSN_TRANS_ACTION_ENUM%20%3D%20(int)PSLibrary.TaskManagement.StatusApprovalType.Accepted%3B%0A%7D%0AConsole.WriteLine(%22Saving%20status%20updates...%22)%3B%0A%0AstatusingClient.UpdateStatusApprovals(statusApprovalDs)%3B%0AGuid%20jobUid%20%3D%20Guid.NewGuid()%3B%0AstatusingClient.QueueApplyStatusApprovals(jobUid%2C%20%22Approving%20all%20status%20updates%20via%20utility%22)%3B%0AHelpers2.WaitForQueue(queueSystemClient%2C%20jobUid)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Visitor

I'm doing integration with Sharepoint and use PSI. I have some troubles with writing actual work, I use WebSvcStatusing.Statusing.UpdateStatus method and PeriodChange element for xml, but after running the code i can't see anything in Approval Center. If i call the QueueApplyStatusApprovals method it fails with JobState.Unknown. I tried to change the project calendar to standard calendar and everything worked out but with custom calendar it doesn't work. I use material resources and own the assignment. When i searched the error message in uls logs there was an SQL error with the code 535 that says "The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart."

 

 

string changeXml = CreateChangeXml(projUid, assnUid, resUid,
                                                   hoursWorked, regularWork, true);
												   
statusingClient.UpdateStatus(changeXml);
statusingClient.SubmitStatus(new Guid[] { assnUid }, "Updated actual work");

SvcStatusing.StatusApprovalDataSet statusApprovalDs = statusingClient.ReadStatusApprovalsSubmitted(false);
for (int i = 0; i < statusApprovalDs.StatusApprovals.Count; i++)
{
	Console.WriteLine("Approving assignment update for {2} to {0} in {1}.", statusApprovalDs.StatusApprovals[i].TASK_NAME, statusApprovalDs.StatusApprovals[i].PROJ_NAME, statusApprovalDs.StatusApprovals[i].RES_NAME);
	statusApprovalDs.StatusApprovals[i].ASSN_TRANS_ACTION_ENUM = (int)PSLibrary.TaskManagement.StatusApprovalType.Accepted;
}
Console.WriteLine("Saving status updates...");

statusingClient.UpdateStatusApprovals(statusApprovalDs);
Guid jobUid = Guid.NewGuid();
statusingClient.QueueApplyStatusApprovals(jobUid, "Approving all status updates via utility");
Helpers2.WaitForQueue(queueSystemClient, jobUid);

 

 

0 Replies