Project is displayed twice on the list page

Document ID : KB000037705
Last Modified Date : 24/08/2018
Show Technical Document Details
Issue:

Symptom

A project is displayed on the project list page twice. The internal ID shown in the URL when clicking into any of the the duplicated project are the same; when querying the inv_investments table for that internal ID or project name or project code only one row is returned.
The user who last updated the project was trying to create a baseline and encountered an error displayed in a pop-up. Unfortunately the user does not remember any details as to what the error was or what was done right before getting the error. The baseline cannot be found on the project or the database so looks like it never got created.
What is causing the project to display twice and how to resolve it?

Steps to Reproduce:

  1. Go to the Project list page
  2. Filter for a project ID

Expected Result:  Only one project matching the ID is returned

Actual Result: A project is listed twice on the page 

 

Cause:
Unable to determine the exact steps to create the exact problem due to lack of details from user. The query for generating the project list filtered result was retrieved from an Action Trace, the query returns two rows when it is run directly on the database. After narrowing down the tables used in the query it is observed that the PRJ_EV_HISTORY table having two records instead of one for the same project.
Resolution:

A simplified query can be run to see the problem:

select *
from inv_investments inv_investments
LEFT OUTER JOIN prj_ev_history EVREC ON EVREC.OBJECT_ID = INV_INVESTMENTS.ID
AND EVREC.OBJECT_TYPE='PROJECT' AND EVREC.PERIOD_NUMBER=0
where inv_investments.id = 5111008 

--5111008 should be replaced by your project's internal ID

A query to identify all duplicates:

SELECT OBJECT_ID, OBJECT_TYPE, PERIOD_NUMBER, count(1) from PRJ_EV_HISTORY group by OBJECT_ID, OBJECT_TYPE, PERIOD_NUMBER having count(1) > 1


In order to resolve the duplicated row:

Run the Update Earned Value and Cost Totals job, selecting the affected project in the job Investment parameter, to clear extraneous record from the PRJ_EV_HISTORY table.

Additional Information:

Additional Information:

See also: TEC1535776 "Load Data Warehouse job fails with ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found on DWH_INV_PROJECT"
See also kb000101876