更新ActualsRow和QueueUpdateTimesheet错误中的实际值 [英] Update Actual Value in ActualsRow and QueueUpdateTimesheet error

查看:50
本文介绍了更新ActualsRow和QueueUpdateTimesheet错误中的实际值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我尝试使用以下代码更新实际值:

I try to update the actual value with this code :

DataSet vacationRequestDataSet = databaseSvc.SelectVacationRequestByVacationRequestGroupId(VacationRequestGroupId);

TimesheetWebSvc.TimesheetDataSet timesheetDataSet = timesheetSvc.ReadTimesheet(TimesheetId);

foreach (DataRow dataRow in vacationRequestDataSet.Tables[0].Rows)
{
    TimesheetWebSvc.TimesheetDataSet.ActualsRow actualsRow = timesheetDataSet.Actuals.FindByTS_LINE_UIDTS_ACT_START_DATE(TSLineId, dataRow.Field<DateTime>("StartDate"));
    actualsRow.SetField<int>("TS_ACT_VALUE", 0);

    timesheetSvc.QueueUpdateTimesheet(Guid.NewGuid(), TimesheetId, timesheetDataSet);
}

我不知道我是否使用了正确的方法,但是我收到了这个错误:

I don't know if I use the correct method but I get this error :

TimesheetIncorrectMode
(3204) 。详细信息:id ='3204'name ='TimesheetIncorrectMode'uid ='c0aa23f2-8777-4f1f-bc15-7e74e03cec85'mode ='0'。

PSError:TimesheetIncorrectMode(3204)

状态更改请求不正确。  Project Server无法处理您的请求。时间表的现有状态是:  (请参阅文档,了解Timesheet状态号的含义)

PSError: TimesheetIncorrectMode (3204)
An incorrect state change request has been made.  Project Server could not process your request. The existing state of the Timesheet is:  (please refer to the documentation for what the Timesheet state number means)

我已经安装了此修补程序:
http://support.microsoft.com/kb/2687354

I have already installed this hotfix : http://support.microsoft.com/kb/2687354

您有什么想法吗?

谢谢,¥b $ b贾斯汀

Thank you,
Justin

推荐答案

嗨Justin,

Hi Justin,

您是否尝试过使用此代码:

Have you tried to use this code:

actualsRow.TS_ACT_VALUE=0;

而不是:

actualsRow.SetField<int>("TS_ACT_VALUE", 0);

TimesheetIncorrectMode当您尝试在时间表中没有任何修改的情况下排队时间表更新作业时,也可能发生错误。在您的示例中,这意味着如果在
代码中显式赋值之前actualRow.TS_ACT_VALUE已经等于零,则可能抛出此异常。

TimesheetIncorrectMode Error may also occur when you're trying to queue timesheet update job without any modifications in the timesheet. In your example it means that if actualRow.TS_ACT_VALUE already equaled to zero before the explicit assignment in the code, then this exception might be thrown.

此外,您可以参考时间表模式枚举的说明,以查看您的时间表在哪种模式下。 

Additionally you can refer to the description of Timesheet mode enum to see in which mode your timesheet was. 

最好的问候,

Alexander Bylinsky

Best Regards,
Alexander Bylinsky


这篇关于更新ActualsRow和QueueUpdateTimesheet错误中的实际值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆