Unable to add time entries using Puttimesheet

  • 1
  • Question
  • Updated 4 years ago
API method: TimesheetService1.PutTimesheet (https://na2.replicon.com/devnetg3/ser...) parameters: { "parameter": { "target": { "uri": null, "user": { "uri": "urn:replicon-tenant:devnetg3:user:73", "loginName": null }, "date": { "year": 2013, "month": 8, "day": 27 } }, "customFieldValues": [], "entries": [ { "timeAllocationEntry": { "target": null, "date": { "year": 2013, "month": 8, "day": 27 }, "duration": { "hours": "5", "minutes": "0", "seconds": "0" }, "projectUri": "urn:replicon-tenant:devnetg3:project:102", "taskUri": "urn:replicon-tenant:devnetg3:task:217", "billingRateUri": null, "activityUri": null, "timeOffTypeUri": null, "customFields": [], "comments": null }, "timePunch": null } ], "noticeExplicitlyAccepted": "true" } } Results in Internal Server Error: error code= Exception correlationId= 47497499-6e1f-4885-bcae-69d78ad0bb97 reason= TimesheetModificationPolicy must be set before performing timesheet modifications stacktrace= at Replicon.TimeSheet.Domain.TimesheetModificationContext.get_CurrentPolicy() in d:\Replicon\2013-08-28@23-02-39\Platform\Production\Replicon.TimeSheet.Domain\TimesheetModificationContext.cs:line 36 at Replicon.TimeSheet.Domain.AmbiguousLegacyUITimesheetOrTimesheet.EnsureTimesheet(User user, Date date, Action`1 queryPreparer) in d:\Replicon\2013-08-28@23-02-39\Platform\Production\Replicon.TimeSheet.Domain\Timesheet.cs:line 1440 at Replicon.TimeSheet.Domain.AmbiguousLegacyUITimesheetOrTimesheet.EnsureTimesheet(User user, Date date) in d:\Replicon\2013-08-28@23-02-39\Platform\Production\Replicon.TimeSheet.Domain\Timesheet.cs:line 1413 at Replicon.Darkwater.Services.BusinessComponents.TimesheetService.PutTimesheet(TimesheetParameter1 parameter, Boolean updateOldTimeoffSchema) in d:\Replicon\2013-08-28@23-02-39\Darkwater Services\Production\Replicon.Darkwater.Services.BusinessComponents\Services\TimesheetService.cs:line 576 at SyncInvokePutTimesheet(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Replicon.ServiceModel.Security.AccessControlOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in D:\Replicon\2013-08-28@23-02-39\Infrastructure\Production\Replicon.ServiceModel\Security\AccessControlOperationInvoker.cs:line 61 at Replicon.ServiceModel.Globalization.CultureBehavior.OperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in D:\Replicon\2013-08-28@23-02-39\Infrastructure\Production\Replicon.ServiceModel\Globalization\CultureBehavior.cs:line 82 at Replicon.Suite.ServiceModel.UserSessionBehavior.OperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in D:\Replicon\2013-08-28@23-02-39\Platform\Production\Replicon.Suite.ServiceModel\UserSessionBehavior.cs:line 87 at Replicon.Darkwater.Server.DarkwaterOperationInvoker.<>c__DisplayClass3.b__0() in D:\Replicon\2013-08-28@23-02-39\Darkwater Services\Production\Replicon.Darkwater.Server\DarkwaterOperationInvoker.cs:line 57 at Replicon.Darkwater.Server.DarkwaterOperationInvoker.ExecuteInOperationContext(Action action, Object serviceInstance, MethodInfo operationMethod, Object[] inputs, IEnumerable`1 faultContracts) in D:\Replicon\2013-08-28@23-02-39\Darkwater Services\Production\Replicon.Darkwater.Server\DarkwaterOperationInvoker.cs:line 40 at Replicon.Darkwater.Server.DarkwaterOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in D:\Replicon\2013-08-28@23-02-39\Darkwater Services\Production\Replicon.Darkwater.Server\DarkwaterOperationInvoker.cs:line 64 at Replicon.ServiceModel.ErrorHandling.ExceptionMappingBehavior.OperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in D:\Replicon\2013-08-28@23-02-39\Infrastructure\Production\Replicon.ServiceModel\ErrorHandling\ExceptionMappingBehavior.cs:line 96 at Replicon.ServiceModel.ErrorHandling.FaultContractValidationBehavior.OperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in D:\Replicon\2013-08-28@23-02-39\Infrastructure\Production\Replicon.ServiceModel\ErrorHandling\FaultContractValidationBehavior.cs:line 99 at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) Unfortunately, I cannot find place in the web admin panel, where I can set this option.

(Originally posted by Josh Huggin)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes

Posted 4 years ago

  • 1
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Hi,

Thank you for using Replicon Community.

When we are using the puttimesheet service, we have to provide the target uri (timesheet uri). Refer the modified request below.

{
"parameter": {
"target": {
"uri": "urn:replicon-tenant:devnetg3:timesheet:221",
"user": {
"uri": "urn:replicon-tenant:devnetg3:user:73",
"loginName": null
},
"date": null
},
"customFieldValues": [],
"entries": [
{
"timeAllocationEntry": {
"target": null,
"date": {
"year": 2013,
"month": 8,
"day": 27
},
"duration": {
"hours": "5",
"minutes": "0",
"seconds": "0"
},
"projectUri": "urn:replicon-tenant:devnetg3:project:102",
"taskUri": "urn:replicon-tenant:devnetg3:task:217",
"billingRateUri": null,
"activityUri": null,
"timeOffTypeUri": null,
"customFields": [],
"comments": null
},
"timePunch": null
},
{
"timeAllocationEntry": null,
"timePunch": null
}
],
"noticeExplicitlyAccepted": "false"
}
}



Thanks



(Originally posted by Lingaraj Dharwad)