Clarity PPM: Duplicate Timesheets Are Displayed

Document ID : KB000004723
Last Modified Date : 19/07/2018
Show Technical Document Details
Issue:

Duplicate timesheets are appearing in the same time period.

If a duplicate does occur, it can introduce an issue in the modern UX Timesheet interface where if a user tries to edit/populate timesheets, one of the error message appears:


"The selected resource’s time tracking settings are not correct. Check that the resource’s settings have Open for Time Entry turned on and the Track Mode is set"

or


"java.lang.Exception: Error encountered populating timesheet from populateCreatedTimesheetWithOption"

User-added image

The corresponding timestamp from when the duplicate timesheet gets created appears as in the APP log as:
WARN 2019-01-29 11:19:30,242 [http-nio-14001-exec-8] niku.union (clarity:sampleuser:10499070__5A31FD04-C8D0-4573-A131-0836E706D0B6:PPM_REST_API) java.lang.Exception: Error encountered populating timesheet from populateCreatedTimesheetWithOptionOverrides: <data> 
<header> 
<messages> 
<message id="timeadmin.TIMESHEET_LOCK_ERROR" location="" type="error" value=""/> 
</messages> 
</header> 
</data> 

 

Cause:

If duplication does occur, the timesheet action sessions could have been duplicated if was a communication issue between the server nodes.


 


 

 

Resolution:

To detect duplicate timesheets, run one or more of the following queries:

--a (To detect the existence of potential duplicate timesheets)

select srm_resources.id as res_id, srm_resources.full_name, prtimeperiod.prstart,
prtimesheet.prtimeperiodid, count(*)
from prtimesheet, prtimeperiod, srm_resources
where prtimesheet.prresourceid = srm_resources.ID
and prtimesheet.prtimeperiodid = prtimeperiod.prid
and prtimeperiod.prstart > to_date('xx/xx/xxxx','mm/dd/yyyy')  --use date 
--and prtimesheet.prresourceid = xxxxxxx --or use resource iid
and prtimesheet.prstatus < 4
group by srm_resources.id,srm_resources.full_name,
prtimeperiod.prstart, prtimesheet.prtimeperiodid
having count(*) > 1

--b (To detect the existence of duplicate timesheets, one that is in Posted status and one in Open status)

select srm_resources.id as res_id, srm_resources.full_name, prtimeperiod.prstart,
prtimesheet.prtimeperiodid, prtimesheet.prstatus, prtimesheet.prid, prtimesheet.pradjustedid
from prtimesheet, prtimeperiod, srm_resources
where prtimesheet.prresourceid = srm_resources.ID
and prtimesheet.prtimeperiodid = prtimeperiod.prid
and srm_resources.id = xxxxxx --provide the resource id from the above query
order by prtimesheet.prtimeperiodid desc

Review the results and determine if there are two timesheets in the same time period that are truly duplicates with query:

select * from prtimesheet where prresourceid = xxxxxx
and prtimeperiodid = yyyyy

If one is in a 'Posted' status and another is in 'Adjusted' status, then this is not a duplicate.

If one is in a 'Posted' status and another is in 'Open' status, then this is a duplicate. The one in 'Open' status would need to be deleted.
 

If there are records returned from any of the above queries, please contact Support for the resolution.