Monday, January 22, 2018

PeopleSoft - Data Conflict Issues

“Come on!!! This is such a simple and straightforward component.. It’s not fair… Why am I running into this issue…”. Ever felt disheartened like this when you see these kind of error messages? 


Data being added conflicts with existing data(18,2 

or 

Changes conflict with another data item. (18,5)


Chill out!! You are not alone.. Let’s set this right..
The prime cause of this issue is because of writing into a PS Record with duplicate key values. Basically, there exists a row with some key values and you are trying to add another row with same key combination, so look out for how did you end up with such duplicate rows. 
I have itemized a few steps which needs validation when you encounter this error

Get the Basics Right – Record Level Structure

Remember your first lesson in creating multiple levels in PS? Yes.. Level 1 record must contain key fields from Level 0 Record and an additional key. Check out if your key structure is right, otherwise fix it now.

Stop Clashing with Component Processor – No Auto Select & No Auto Update Property

Either you do the selection of rows from tables or allow the component processor to do it for you. When you populate a grid or scroll area through peoplecode, you must check the ‘No Auto Select’ property. Likewise, when you have decided to take care of updating the backend records, better select the ‘No Auto Update’ option. When you ignore this, you end up updating the same row twice leading to this issue. 
Thoroughly check all the grid and scroll area properties from your main and secondary pages and make sure you don’t clash with the component processor.


I would recommend allowing the component processor to do its job unless you have some business requirement that requires selection or updation through peoplecode. Atleast try avoiding SQLEXEC statements to insert or update records which are readily available in your component buffer. Why reinvent the wheel??

Weird Field Assignments

Let’s say you have a field named ‘COMPANY’ which is a key field in one of your records and a peoplecode in ‘PreBuild’ or ‘Rowinit’ event sets a default value to this field. If this field is editable and user enters some value and saves it, the next time when user opens the page again, the default value is displayed again and if you try to modify this key field and save again, you will encounter Data Inconsistency issue.
So always look for such weird field assignments/modifications, 
Check out for Saveprechange or Savepostchange events, if some code is modifying your key values.
Did you overlook your record peoplecode? There are chances that the same record is being used in multiple components and the code written for some other purpose gets triggered for our business transaction resulting in data conflict issues.

Out of sync Sequence Numbers

When you use sequence numbers in your page that needs to be incremented and updated every time, better not to go with SQLEXEC Update statements, Instead use the delivered getNextNumberwithGapsCommit() function. This can help avoid data inconsistency issues. 

Clear App Server Cache

For no reason, if most of the users receive data conflict issues, I would suggest to clear the app server cache. Believe me, it helps sometimes.

3 comments:

  1. Very helpful one bro , thanks and cheers

    ReplyDelete
  2. Thanks Santosh,super clear explanation as always.

    ReplyDelete
  3. Well written article. Get rid of the traditional ways of marketing and buy a customized email list from us. One real-time data can change your entire business for good. Parana Impact provides you the Email List that you are exactly looking for.
    We have worked with many organizations of all the sizes. Our main focus is customer satisfaction. PeopleSoft Users Email List

    ReplyDelete