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

Unable to update record due to pyID error

SA-10874

Summary



When trying to update a record using Obj-Save method, an error occurs indicating that the data class (ORG-APPLICATION-Case-Data-Test) belongs to a fully exposed table (EXAMPLE_SOURCE) but the instance has properties (pyID) which do not correspond to columns. The pyID property is not present in the class or in the database table.

Error Messages



In Tracer:
DATABASE-BADTABLEMAPPING-TOOMANYPROPERTIES
Cannot save instance of class ORG-APPLICATION-Case-Data-Test; it belongs to fully exposed table PC_TEST_DATA in database PegaRULES, but the instance has properties which do not correspond to columns: pyID


In PegaRULES log:
14:20:08,639 [fault (self-tuning)'] (QW_Data_ROOTCAUSE.Action) ERROR your_application.com user - obj-save failed.
com.pega.pegarules.pub.database.BadTableMappingException: Database-BadTableMapping-TooManyProperties    ORG-APPLICATION-Case-Data-Test    PC_TEST_DATA    PegaRULES    pyID
From: (H919C5C5FB82F0436CF8E74F82114C193:your_application.com)
    at com.pega.pegarules.data.internal.access.PageDatabaseMapperImpl.fillInInternalSaveStatementFromPageWithoutStream(PageDatabaseMapperImpl.java:1390)
    at com.pega.pegarules.data.internal.access.Saver.saveExistingInstanceWithNoDeletedColumnNotOnlyIfNew(Saver.java:1244)
    at com.pega.pegarules.data.internal.access.Saver.saveInstance(Saver.java:853)
    at com.pega.pegarules.data.internal.access.DatabaseImpl.performOps(DatabaseImpl.java:2955)
    at com.pega.pegarules.data.internal.access.DatabaseImpl.attemptToProcessUpdates(DatabaseImpl.java:2312)
    at com.pega.pegarules.data.internal.access.DatabaseImpl.processUpdates(DatabaseImpl.java:2165)
    at com.pega.pegarules.data.internal.access.Saver.save(Saver.java:643)
    at com.pega.pegarules.data.internal.access.DatabaseImpl.save(DatabaseImpl.java:4826)
    at com.pegarules.generated.activity.ra_action_savedataobject_2be7b769d0988fdafc900689a4cd9a01.step1_circum0(ra_action_savedataobject_2be7b769d0988fdafc900689a4cd9a01.java:230)
    at com.pegarules.generated.activity.ra_action_savedataobject_2be7b769d0988fdafc900689a4cd9a01.perform(ra_action_savedataobject_2be7b769d0988fdafc900689a4cd9a01.java:72)


Steps to Reproduce



1. Configure a button to open a harness at onClick event. 
2. Configure the harness so that it loads and displays some data of a data class (the class and the classes of its inheritance path must not contain any pyID property). On submitting, an activity should execute an Obj-Save step on the page of the data class that has been updated from the harness.


Root Cause



The root cause of this problem is that the pyID is populated in the clipboard page by When tags (mentioned below) that are present in the harness rule.
When Pega creates a harness rule, the below mentioned code snippet is automatically added in the source of the harness.
Implementation of the when tag creates a pyID on the primary clipboard page while evaluating the condition, which causes the issue while saving the harness.


<pega:when test=".pyID != \'\'"><td style='padding-left:0px;padding-right:3px;height:20px;width:20px;'>
</pega:when>
<pega:when test=".pyID != \\\'\\\'"><nobr><%pxIconHistory_1();%></nobr></td>
</pega:when>
<pega:when test=".pyID != \'\'"><td style='padding-left:0px;padding-right:3px;height:20px;width:20px;'>
</pega:when>
<pega:when test=".pyID != \\\'\\\'"><nobr><%pxIconAttachments_1();%></nobr></td>
</pega:when><td style='padding-left:0px;padding-right:3px;height:20px;width:20px;'><nobr><%pxIconExpandCollapse_1();%></nobr></td><td style='padding-left:0px;padding-right:3px;height:20px;width:20px;'><nobr><%pxIconCancel_1();%></nobr></td>


Resolution



This issue is resolved through the following local-change:

Add a Property-Remove step before Obj-Save, to remove "pyID".
Suggest Edit

Published November 17, 2015 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

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

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