Data Being Added Conflicts with Existing Data

While developing a page with multiple scrolls levels, and especially when using a grid, you may get the error Data being added conflicts with existing data. (18,2).

data-being-added-conflicts-with-existing-data.png

This suggests a problem with the key structures in the tables in your lower scroll levels.

For example, you may have a parent record at scroll 0 with the keys: INSTITUTION and EFFDT, and then a child record at scroll 1 with the same keys INSTITUTION and EFFDT. That is, no additional key(s) to indicate the child data. If you are building a parent-child relationship, child records should have more keys than parent records, otherwise you have a design flaw.

A tell-tale sign of this in a grid, is that when you add another row in your grid all data is copied automatically to the new row. Check your child record (the one in your lower scroll level or grid) and examine the key structures, are you missing one or more keys?

Also check your overall page levels, do you have the scroll levels at the right occurs level? For example, do you have a child record a higher scroll level (1) than its parent (at 0)? If not, fix up the occurs level in your scroll bar, scroll area or grid.

This error may also be happening because keys are not propagating correctly from parent-to-children records. Check the rows in your child record and ensure that it has the same high level keys as its parents. This is particularly common with the OPRID and RUN_CNTL_ID fields when working with run control records.

Another cause may be PeopleCode that modifies your key fields. For example, do you set a key field's value on FieldDefault, and then modify it later, say on SavePreChange causing a buffer mismatch?

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License