search cancel

Financial Data: Location is missing in XOG XML

book

Article ID: 189663

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

You have an existing project that is financially enabled.  You change the department (which clears out the Location attribute) and save the project.  At a later date, you re-populats the location and save.  The location shows up in the UI, but when you XOG the project out, the location is not present in the XML. 

If you try to change the location in the UI, you the get the error message in the log file.

ERROR 2020-04-20 12:56:15,520 [ajp-nio-8009-exec-5] niku.xql2 (clarity:user:xxxxxxxxx:projmgr.projectPropertiesPost) Internal Processing exception

com.niku.union.persistence.PersistenceException:

SQL error code: 2601

Error message: [CA Clarity][SQLServer JDBC Driver][SQLServer]Cannot insert duplicate key row in object 'niku.OBS_UNIT_ENTITIES_V2' with unique index 'OBS_UNIT_ENTITIES_V2U1'. The duplicate key value is (5066009, SRM_PROJECTS, OBS_UNIT_AND_CHILDREN, 5001001).

SQL error code: 3621

What is causing this error in the environment and how we can avoid this error?

Cause

 This is due to a permission issue when you have Location level OBS rights and maks the change to Location. Example: 

  1. With OBS rights to the location HQ, go into a project and change the Department. This clears out the Location.
  2. Click Save. When you have OBS Rights and click Save, an Error 401 occurs. This is happening because you are saving a value that you don’t have the rights to.  (Location = blank is not valid for someone who only has OBS Rights to the Location HQ).
  3. When you have rights to all Locations and go to the project, the Location looks like it’s still populated with HQ, but something is not valid on the back end. 
  4. You’ll notice that the Financial Plans tab is now missing and the Department change did not get committed. In fact, none of the changes made are saved.
  5. Now, as a user with access to ALL locations, try to change the Department to something other than HQ, you get the error: System Error Contact System Administrator

Environment

Release : Any

Resolution

  1. XOG the project out
  2. Add the location OBS info into the XML
  3. XOG the project back in.

Suggestion:

  1. Make Department and Location Required
  2. Flip the order of Department and Location so they follow the logical flow that the application expects.
  3. That way, as a Location user, if you try to change the Department and leaves the Location blank, you will get an error that a Value is required.  And when you try to pick a Location, the only option you have is HQ, so you will not be able to select bad data.