Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Datatable and edit a column part of PK

SA-9400

Summary



When editing a row in a Datatable using "Edit data instances" or "Edit and Search", instead of updating the existing row a new row is added to the table.

Error Messages



Not Applicable.

Steps to Reproduce



1. Create a data table, in my case with two columns, the database already Type Workbaskcontains the table:
 
Code of existing table:
CREATE TABLE "WORKBASKETTABLE"
(
"PXCREATEDATETIME" DATE,
"PXCREATEOPNAME" VARCHAR2(128 BYTE),
"PXCREATEOPERATOR" VARCHAR2(128 BYTE),
"PXCREATESYSTEMID" VARCHAR2(32 BYTE),
"PXINSNAME" VARCHAR2(128 BYTE),
"PXOBJCLASS" VARCHAR2(96 BYTE),
"PXUPDATEDATETIME" DATE,
"PXUPDATEOPNAME" VARCHAR2(128 BYTE),
"PXUPDATEOPERATOR" VARCHAR2(128 BYTE),
"PXUPDATESYSTEMID" VARCHAR2(32 BYTE),
"PYLABEL" VARCHAR2(64 BYTE),
"PYRULESETNAME" VARCHAR2(64 BYTE),
"PZINSKEY" VARCHAR2(255 BYTE) NOT NULL ENABLE,
"WORKBASKET" VARCHAR2(128 BYTE),
"TYPE" VARCHAR2(128 BYTE),
"PZPVSTREAM" BLOB,
CONSTRAINT PK_WORKBASKETTABLE PRIMARY KEY ("PZINSKEY")
)
2. Set the keys in the class, so PZINSKEY = Type + Workbasket.
3. Set the mapping with the table in database with a database table object.
4. In Data Model - Data Tables page open the datatable ( or icon, same result)
5. Add a new row with the values.
6. Edit this row, in my case : Pilotage 25 -> Pilotage 29:


Root Cause



The administrator has created the datatable using a manual approach. This process is not recommended and supported.

Resolution



Create a Datatable using the provided wizard. When creating a Datatable via the wizard, the administrator can choose which attributes should be the Key of the table. By doing so, user cannot modify the Key values and the rows do not get duplicated.

Published June 12, 2015 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us